# `Wardrik.Channel.Installations`

A behaviour for storing the workspaces a channel is added to, each with its token.

  * A channel takes one as `installations: {module, opts}`.
  * Without it, a channel given `token:` serves only that token's workspace.
  * Tokens are secrets. Store them as you store your others.

# `delete`

```elixir
@callback delete(Wardrik.Channel.Installations.Request.t(), opts :: term()) :: :ok
```

Deletes the channel's installation in the request's `workspace`, if there is one.

# `fetch`

```elixir
@callback fetch(Wardrik.Channel.Installations.Request.t(), opts :: term()) ::
  {:ok, Wardrik.Channel.Installation.t()} | :error
```

Fetches the channel's installation in the request's `workspace`.

# `owned`

```elixir
@callback owned(Wardrik.Channel.Installations.Request.t(), opts :: term()) :: [
  Wardrik.Channel.Installation.t()
]
```

Returns the channel's installations whose `owner` is the request's.

# `put`

```elixir
@callback put(Wardrik.Channel.Installation.t(), opts :: term()) ::
  :ok | {:error, String.t()}
```

Stores `installation`, replacing any with the same channel and workspace.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
