DripDrop.Channels (DripDrop v0.1.0)

Copy Markdown View Source

Registry and lookup helpers for built-in and host-registered channel providers.

Summary

Functions

Returns all known channel keys.

Normalizes channel and provider keys into existing atoms.

Looks up the module for a channel/provider pair.

Returns all known provider keys for a channel.

Registers a host-defined channel provider.

Functions

channels()

@spec channels() :: [atom()]

Returns all known channel keys.

normalize_key(key)

@spec normalize_key(atom() | binary()) :: {:ok, atom()} | :error

Normalizes channel and provider keys into existing atoms.

provider_module(channel, provider)

@spec provider_module(atom() | binary(), atom() | binary()) ::
  {:ok, module()} | {:error, term()}

Looks up the module for a channel/provider pair.

providers(channel)

@spec providers(atom() | binary()) :: [atom()]

Returns all known provider keys for a channel.

register(channel, provider, module)

@spec register(atom() | binary(), atom() | binary(), module()) ::
  :ok | {:error, term()}

Registers a host-defined channel provider.