Cyclium.Output.Adapter behaviour (Cyclium v0.2.2)

Copy Markdown View Source

Behaviour for output delivery adapters (email, Slack, issues, etc.). The consuming app provides implementations per output type.

Adapters are registered via app config:

config :cyclium, :output_adapters, %{
  email: MyApp.Adapters.Email,
  slack: MyApp.Adapters.Slack
}

Summary

Functions

List all registered output adapter type names.

Resolve an output adapter module by type name. Returns nil if no adapter is registered for the given type.

Callbacks

deliver(type, payload, ctx)

@callback deliver(type :: atom(), payload :: map(), ctx :: map()) ::
  {:ok, ref :: map()} | {:error, reason :: term()}

Functions

all()

List all registered output adapter type names.

resolve(type)

Resolve an output adapter module by type name. Returns nil if no adapter is registered for the given type.