Application-owned server integration contract.
Adapters may authenticate accounts, consume committed domain events, answer application state queries, and observe outbound IRC messages. All callbacks are serialized by the server's adapter worker except authentication, which runs in a bounded task.
Summary
Types
A protocol action that needs an authorization decision.
Server and actor data for one callback.
An application-owned state operation.
A query supported by the built-in ETS adapter.
Application state for one server adapter.
Callbacks
Verifies SASL credentials and returns an application account.
Returns true when the initialized adapter can authenticate accounts.
Allows or rejects a protocol action before the server changes state.
Handles an IRC command that the protocol engine does not recognize.
Consumes one committed server event and returns the next adapter state.
Handles an application operation from Ircxd.Server.execute/2.
Observes one outbound IRC message, including numerics.
Handles an application query from Ircxd.Server.query/2.
Initializes the adapter state from the configured argument.
Types
@type action() :: term()
A protocol action that needs an authorization decision.
@type context() :: map()
Server and actor data for one callback.
@type operation() :: term()
An application-owned state operation.
@type query() :: :users | :channels | {:channel, String.t()} | {:channels_for, String.t()} | {:channel_roles, String.t(), String.t()} | {:messages, String.t(), keyword()}
A query supported by the built-in ETS adapter.
@type state() :: term()
Application state for one server adapter.
Callbacks
@callback authenticate(String.t(), String.t(), map(), state()) :: {:ok, term(), state()} | {:error, term(), state()}
Verifies SASL credentials and returns an application account.
Returns true when the initialized adapter can authenticate accounts.
Allows or rejects a protocol action before the server changes state.
@callback handle_command(Ircxd.Message.t(), context(), state()) :: {:unhandled, state()} | {:reply, [Ircxd.Message.t()], state()} | {:error, term(), state()}
Handles an IRC command that the protocol engine does not recognize.
@callback handle_event(Ircxd.Server.Event.t(), context(), state()) :: {:ok, state()}
Consumes one committed server event and returns the next adapter state.
@callback handle_operation(operation(), context(), state()) :: {:ok, term(), state()} | {:error, term(), state()}
Handles an application operation from Ircxd.Server.execute/2.
@callback handle_publish(Ircxd.Message.t(), map(), state()) :: {:ok, state()}
Observes one outbound IRC message, including numerics.
@callback handle_query(query(), context(), state()) :: {:ok, term(), state()} | {:error, term(), state()}
Handles an application query from Ircxd.Server.query/2.
Initializes the adapter state from the configured argument.