Skip to main content

Module stores

Module stores 

Source
Expand description

Named shared stores (stores: in gateway.yaml): redis/valkey connections referenced by name from plugin config (store: <name>).

StoreRegistry holds one client per named store. It is rebuilt by crate::state::SharedState::compile_routes on every config (re)compile, reusing the previous client when a store’s resolved config is unchanged (so an unrelated reload does not drop connections). The registry lives in crate::plugins::resources::PluginResources behind an ArcSwap and is only read at plugin-construction time — never on the request path — so a bad store: reference fails policy compilation, not a request.

Backend code is gated behind the default-on redis-store cargo feature; a headless --no-default-features build rejects any declared store at config load with a descriptive error.

Modules§

counter
Redis-backed fixed-window counter (policy: redis for limit-count and the workflow limit-count action).
namespaces
The key namespaces featherbit writes under a store’s key_prefix.
redis_cache
Shared response cache over a declared stores: entry.
redis_store
Redis/Valkey client for named stores (redis-store feature).

Structs§

StoreRegistry
One client per named store, plus the counter backend built on it. Read-only after construction; replaced wholesale via the ArcSwap in PluginResources when config changes.

Functions§

validate_stores
Validates the stores: section: unique non-empty names, known types, and v1 topology restrictions (standalone only). Runs before any client is built, in every compile path (file, etcd, Admin API, dry-run).