LemonGateway.TransportRegistry (lemon_gateway v0.1.0)

View Source

Registry of available transport modules.

Maintains a mapping of transport ID strings to their implementing modules. Tracks which transports are enabled via configuration and warns about misconfigured transports at startup.

Summary

Functions

Returns a specification to start this module under a supervisor.

Returns the transport module for the given ID, or nil if not registered.

Returns the transport module for the given ID, or raises if not found.

Returns a list of all registered transport IDs.

Types

transport_id()

@type transport_id() :: String.t()

transport_mod()

@type transport_mod() :: module()

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

enabled_transports()

@spec enabled_transports() :: [{transport_id(), transport_mod()}]

get_transport(id)

@spec get_transport(transport_id()) :: transport_mod() | nil

Returns the transport module for the given ID, or nil if not registered.

get_transport!(id)

@spec get_transport!(transport_id()) :: transport_mod()

Returns the transport module for the given ID, or raises if not found.

list_transports()

@spec list_transports() :: [transport_id()]

Returns a list of all registered transport IDs.

start_link(opts)