Skip to main content

Module config

Module config 

Source
Expand description

Config loading entry point.

See spec/crates/core.md § Config layers. Module responsibilities:

  1. Best-effort dotenvy load of <config_dir>/.env. OS env winsdotenvy::from_path does not override pre-existing keys, which matches operator expectations (systemd / supervisor unit files are authoritative).
  2. Scan <config_dir>/rules/*.json for RawRuleFiles.
  3. Read every VANE_* deployment constant into a typed Env snapshot.

Structs§

Env
Typed snapshot of every VANE_* deployment constant the daemon reads at startup. Defaults match spec/crates/core.md § Config layers.
LoadedConfig
Result of load: rule files (unmerged) plus the typed Env snapshot. Downstream callers thread files into crate::compile::compile and read env for deployment constants.
ProcessEnv
Production EnvReader — reads from std::env.

Traits§

EnvReader
Reads a key → optional string value. The single production implementation, ProcessEnv, delegates to std::env::var. Tests hand-roll a fake EnvReader to keep state local.

Functions§

load
Load a vane config directory.
scan_rules_dir
Scan a directory for *.json rule files. Returns one RawRuleFile per discovered file with path populated from the on-disk filename. Order of the returned vector is unspecified — the merge stage sorts by (order asc, path lex) so the loader does not pre-sort.