Module config_source

Module config_source 

Source
Expand description

Configuration source extension point.

§Contract: ConfigSource

Purpose: produce the current Gateway configuration on demand.

Semantics: load is a full read of the current configuration generation. It may be called on startup, on demand, and (once DW-006 lands) whenever the source signals a change. Implementations should be cheap to call repeatedly but need not cache. load is not expected to run on the request hot path.

Watch contract (documented, NOT implemented here — DW-006): an OSS file-watch source will notify the runtime on file change; the trait deliberately keeps load pull-only so watch mechanics (tokio watch channel, notify crate) can be layered by the consumer without a signature change. Future revisions may add an optional subscribe method with a default no-op implementation, which is backward compatible.

Failure model: unreadable source maps to ExtensionsError::Io; malformed configuration maps to ExtensionsError::Invalid (wrapping the path-precise crate::config::ConfigError message). No retries.

Editions: OSS ships FileConfigSource (single YAML file). Additional remote/control-plane sources may be provided separately in future editions.

Structs§

FileConfigSource
Single-file YAML configuration source (OSS).

Traits§

ConfigSource
Swappable configuration origin.