WardrikChannel. Channel
(wardrik_channel v0.1.0-rc.1)
Copy Markdown
One chat app Wardrik runs, under the name it's given.
Holds the adapter, the adapter's own options, and the installations that say where it's added. Wardrik passes it the rest:
:server- theWardrik.Serverthat runs operations.:wardrik- the instance.:events- where events are followed and recorded.:store- Wardrik's store.:vault- where tokens are sealed.nilwithout Wardrik's:keys.
Summary
Functions
Saves installation, replacing any for the same workspace.
Returns the channel's installation in workspace, as the chat app names it.
Returns the installation nearest the owner of agent id.
Builds adapter's channel from the options Wardrik passes it. See WardrikChannel for the
options.
Forgets the channel's installation in workspace.
Types
@type t() :: %WardrikChannel.Channel{ adapter: module(), approvers: [String.t()] | :anyone, deciding: String.t(), events: atom(), installations: {module(), term()}, name: String.t(), offering: String.t(), options: keyword(), server: module(), store: WardrikStore.t(), vault: atom() | nil, wardrik: atom() }
Functions
@spec install(t(), Wardrik.Channel.Installation.t()) :: :ok | {:error, String.t()}
Saves installation, replacing any for the same workspace.
@spec installation(t(), String.t()) :: {:ok, Wardrik.Channel.Installation.t()} | :error
Returns the channel's installation in workspace, as the chat app names it.
@spec nearest(t(), String.t()) :: {:ok, Wardrik.Channel.Installation.t()} | :error
Returns the installation nearest the owner of agent id.
Looks first for one owned by the user, as acme/@jon, then by the org, as acme. Returns
:error if there's neither.
Builds adapter's channel from the options Wardrik passes it. See WardrikChannel for the
options.
Raises ArgumentError if the name isn't lower-case letters, digits and -, starting with a
letter, or if the options give neither or both of :token and :installations.
Forgets the channel's installation in workspace.