# bandera v0.1.0 - Table of Contents

> Feature flag library with runtime config for storage backends and caching.

## Modules

- [Bandera](Bandera.md): Runtime-configured feature flags, API-compatible with fun_with_flags.
- [Bandera.Actor](Bandera.Actor.md): Identifies an actor (e.g. a user) for actor and percentage_of_actors gates.
The id must be a binary and stable for a given actor across a flag's lifetime.
- [Bandera.Config](Bandera.Config.md): Resolves all Bandera settings at RUNTIME and caches them in a `:persistent_term`
snapshot for cheap hot-path reads.
- [Bandera.Ecto.Migrations](Bandera.Ecto.Migrations.md): Helpers for creating the Bandera flags table. Call from your own migration
- [Bandera.Flag](Bandera.Flag.md): A named feature flag (a collection of gates) and its evaluation.
- [Bandera.Gate](Bandera.Gate.md): A single feature-flag gate and its evaluation.
- [Bandera.Group](Bandera.Group.md): Determines whether a given item (actor) belongs to a named group.
Group names are compared as strings.
- [Bandera.Notifications](Bandera.Notifications.md): Cross-node cache-busting notifications.
- [Bandera.Notifications.PhoenixPubSub](Bandera.Notifications.PhoenixPubSub.md): Phoenix.PubSub cache-busting notifier. Subscribes to a topic and, on a flag
change broadcast by ANOTHER node, busts the local cache entry. Self-published
changes are ignored. The PubSub server name is read at runtime from
`config :bandera, cache_bust_notifications: [client: MyApp.PubSub]`.

- [Bandera.Notifications.Redis](Bandera.Notifications.Redis.md): Redis PubSub cache-busting notifier (via Redix). Subscribes to a channel and,
on a flag change published by ANOTHER node, busts the local cache entry for
that flag. Self-published changes are ignored. Connection options are read at
runtime from `config :bandera, cache_bust_notifications: [redis: <Redix opts>]`.
- [Bandera.Store](Bandera.Store.md): Behaviour for the active store the public API talks to.
- [Bandera.Store.Cache](Bandera.Store.Cache.md): ETS read cache for flags. Always started; bypassed by the store when the cache
is disabled (so the cache can be toggled at runtime without races). The TTL is
read from the runtime `Bandera.Config` snapshot at lookup time.
- [Bandera.Store.Persistent](Bandera.Store.Persistent.md): Behaviour for durable flag storage adapters (Memory, Ecto, Redis).
- [Bandera.Store.Persistent.Ecto](Bandera.Store.Persistent.Ecto.md): SQL persistence adapter. The repo and table name are read from
`Bandera.Config` at RUNTIME and queries bind the table via Ecto's
`{table_name, Record}` source form, so nothing about the table is fixed at
compile time. The `Record` schema supplies field types so values (e.g.
booleans) cast portably across SQL backends.
- [Bandera.Store.Persistent.Ecto.Record](Bandera.Store.Persistent.Ecto.Record.md): Ecto schema for a single flag-gate row. The `schema "bandera_flags"` source is
only a placeholder/default; the adapter always overrides it at query time via
`{Bandera.Config.ecto_table_name(), Record}`, so the table name stays runtime
configured (no compile-time table config). The schema exists purely to give
Ecto the field types needed for portable casting (e.g. booleans) across SQL
backends.

- [Bandera.Store.Persistent.Ecto.Serializer](Bandera.Store.Persistent.Ecto.Serializer.md): Pure mapping between `Bandera.Gate`s and SQL table rows.
- [Bandera.Store.Persistent.Memory](Bandera.Store.Persistent.Memory.md): In-memory (ETS) persistence adapter. The default backend; suitable for
single-node deployments and development. Not durable across restarts.
- [Bandera.Store.Persistent.Redis](Bandera.Store.Persistent.Redis.md): Redis persistence adapter (via Redix).
- [Bandera.Store.Persistent.Redis.Serializer](Bandera.Store.Persistent.Redis.Serializer.md): Pure mapping between `Bandera.Gate`s and Redis hash `{field, value}` pairs.
- [Bandera.Store.ProcessScoped](Bandera.Store.ProcessScoped.md): Process-scoped overlay store for tests, backed by `NimbleOwnership`.
- [Bandera.Store.TwoLevel](Bandera.Store.TwoLevel.md): Default store: an ETS cache in front of a persistent adapter. Whether the cache
is consulted is decided per-call from the runtime `Bandera.Config` snapshot
(read from `:persistent_term`), so caching can be toggled at runtime with no
recompilation. The persistent adapter is also runtime-selected.
- [Bandera.Telemetry](Bandera.Telemetry.md): Telemetry events for Bandera.
- [Bandera.Test](Bandera.Test.md): Test helpers for toggling Bandera flags with per-test, async-safe isolation.

- Exceptions
  - [Bandera.Gate.InvalidTargetError](Bandera.Gate.InvalidTargetError.md): Raised when a percentage gate is built with a ratio outside `0.0 < r < 1.0`.

