PtcRunner.Kernel.ViewerBinding (PtcRunner v0.14.0)

Copy Markdown View Source

Closed ptc viewer listener vocabulary.

The strict parser and the Viewer frontend share this module so a bind address is decided in exactly one place. Loopback is the default and the only address reachable without naming it; the single non-loopback value is the wildcard, which publishes an unauthenticated trace browser to every host that can reach the port. A general address parser would turn a typo into a different exposure, so the vocabulary is closed rather than parsed.

Summary

Functions

Resolves one --listen value; an absent value is loopback.

True for every address this command may bind.

Accepted --listen spellings, for help and diagnostics.

True when the address exposes the Viewer beyond this host.

The address bound when --listen is absent.

Resolves one --port value.

Types

address()

@type address() :: :inet.ip4_address()

Functions

address(value)

@spec address(binary() | nil) :: {:ok, address()} | :error

Resolves one --listen value; an absent value is loopback.

address?(address)

@spec address?(term()) :: boolean()

True for every address this command may bind.

addresses()

@spec addresses() :: [binary()]

Accepted --listen spellings, for help and diagnostics.

exposed?(arg1)

@spec exposed?(term()) :: boolean()

True when the address exposes the Viewer beyond this host.

loopback()

@spec loopback() :: address()

The address bound when --listen is absent.

port(value)

@spec port(binary()) :: {:ok, 0..65535} | :error

Resolves one --port value.

0 is accepted and asks the operating system for an ephemeral port, matching the project configuration schema.