Skip to main content

Module loader

Module loader 

Source
Expand description

Layered config loader.

Precedence (later overrides earlier):

Defaults < File < EnvVars < CLI

Matches JSS src/config.js:211-239. Sprint 11 (row 120-124) closes the remaining gap by adding the CLI overlay, YAML/TOML file support (via the config-loader feature), and the full JSS env-var map.

The loader:

  1. Walks the registered sources in order.
  2. Resolves each into a serde_json::Value tree.
  3. Deep-merges each overlay into the accumulator.
  4. Deserialises into ServerConfig.
  5. Runs ServerConfig::validate and returns the snapshot.

Unknown JSON fields are tolerated (every sub-struct uses #[serde(default)]), matching the “forward-compat with newer JSS releases” invariant in the bounded-context doc.

Structs§

CliArgs
CLI-derived overlay values. Each field is Option<_> so the operator can leave every flag unset (yielding a no-op overlay).
ConfigLoader
Builder for a layered config load.