Resolves all Bandera settings at RUNTIME and caches them in a :persistent_term
snapshot for cheap hot-path reads.
This module deliberately uses NO Application.compile_env/3. Every value is read
from Application.get_env/3 and can be changed at runtime via reload/0, with no
dependency recompilation. (Fixes fun_with_flags#122.)
Summary
Functions
Generate a random per-node id used to ignore self-published change notifications.
Whether the read cache is enabled (default true).
Cache time-to-live in seconds (default 900).
The SQL table name used by the Ecto adapter (default "bandera_flags").
The dashboard's flag-grouping separator (default "_"; nil disables grouping).
The full notifications keyword config (adapter plus adapter-specific options).
The notifications adapter module (default Bandera.Notifications.Redis).
Whether cross-node cache-busting notifications are enabled (default false).
The full persistence keyword config (adapter plus adapter-specific options).
The persistence adapter module (default Bandera.Store.Persistent.Memory).
Re-read application env and rewrite the persistent_term snapshot.
Return the current snapshot, seeding it lazily if not yet present.
The active store module (default Bandera.Store.TwoLevel).
The dashboard's styling theme (default :standalone).
Types
@type snapshot() :: %{ store: module(), cache_enabled?: boolean(), cache_ttl: non_neg_integer(), persistence_adapter: module(), persistence: keyword(), notifications_enabled?: boolean(), notifications_adapter: module(), notifications: keyword(), group_separator: String.t() | nil, theme: :standalone | :daisyui }
Functions
@spec build_unique_id() :: String.t()
Generate a random per-node id used to ignore self-published change notifications.
@spec cache_enabled?() :: boolean()
Whether the read cache is enabled (default true).
@spec cache_ttl() :: non_neg_integer()
Cache time-to-live in seconds (default 900).
@spec ecto_table_name() :: String.t()
The SQL table name used by the Ecto adapter (default "bandera_flags").
@spec group_separator() :: String.t() | nil
The dashboard's flag-grouping separator (default "_"; nil disables grouping).
@spec notifications() :: keyword()
The full notifications keyword config (adapter plus adapter-specific options).
@spec notifications_adapter() :: module()
The notifications adapter module (default Bandera.Notifications.Redis).
@spec notifications_enabled?() :: boolean()
Whether cross-node cache-busting notifications are enabled (default false).
@spec persistence() :: keyword()
The full persistence keyword config (adapter plus adapter-specific options).
@spec persistence_adapter() :: module()
The persistence adapter module (default Bandera.Store.Persistent.Memory).
@spec reload() :: :ok
Re-read application env and rewrite the persistent_term snapshot.
@spec snapshot() :: snapshot()
Return the current snapshot, seeding it lazily if not yet present.
@spec store() :: module()
The active store module (default Bandera.Store.TwoLevel).
@spec theme() :: :standalone | :daisyui
The dashboard's styling theme (default :standalone).
:standalone inlines a self-contained stylesheet; :daisyui emits daisyUI
classes and no stylesheet, for apps that build daisyUI themselves. Any other
value normalizes to :standalone.