# `Bandera.Store.Persistent`

Behaviour for durable flag storage adapters (Memory, Ecto, Redis).

# `all_flag_names`

```elixir
@callback all_flag_names() :: {:ok, [atom()]} | {:error, term()}
```

Returns `{:ok, names}` with every stored flag name, or `{:error, reason}`.

# `all_flags`

```elixir
@callback all_flags() :: {:ok, [Bandera.Flag.t()]} | {:error, term()}
```

Returns `{:ok, flags}` with every stored flag, or `{:error, reason}`.

# `delete`

```elixir
@callback delete(flag_name :: atom()) :: {:ok, Bandera.Flag.t()} | {:error, term()}
```

Removes the entire flag from durable storage and returns the resulting empty flag.

# `delete`

```elixir
@callback delete(flag_name :: atom(), gate :: Bandera.Gate.t()) ::
  {:ok, Bandera.Flag.t()} | {:error, term()}
```

Removes a single `gate` from durable storage and returns the updated flag.

# `get`

```elixir
@callback get(flag_name :: atom()) :: {:ok, Bandera.Flag.t()} | {:error, term()}
```

Reads a flag straight from durable storage. Returns `{:ok, flag}` or `{:error, reason}`.

# `put`

```elixir
@callback put(flag_name :: atom(), gate :: Bandera.Gate.t()) ::
  {:ok, Bandera.Flag.t()} | {:error, term()}
```

Persists `gate` onto the flag and returns the updated flag (or `{:error, reason}`).

---

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