The route table: name → loopback port, held in ETS behind a GenServer so writes serialize and reads stay lock-free on the hot proxy path.
Names are the DNS label before .localhost: lowercase letters,
digits, and hyphens, dots allowed for subdomain-style names
(api.myapp). cherrypicker itself is reserved for the control API.
Summary
Functions
Returns a specification to start this module under a supervisor.
Removes a route; removing an absent route is not an error.
The port for a name, if routed.
Every route, name-sorted.
Registers or replaces a route. Errors on bad names and ports.
Types
@type name() :: String.t()
@type route() :: %{name: name(), port: :inet.port_number()}
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec delete(name()) :: :ok
Removes a route; removing an absent route is not an error.
@spec fetch(name()) :: {:ok, :inet.port_number()} | :error
The port for a name, if routed.
@spec list() :: [route()]
Every route, name-sorted.
@spec put(name(), :inet.port_number()) :: :ok | {:error, String.t()}
Registers or replaces a route. Errors on bad names and ports.
@spec start_link(keyword()) :: GenServer.on_start()