pub fn load_config<T>(
config_path: Option<&str>,
env_prefix: &str,
) -> Result<T, ConfigError>Expand description
Load config with full cascade: YAML -> figment env -> flat env -> normalise.
This replaces the copy-pasted Config::load() functions across DFE services.
It orchestrates:
.envloading (via dotenvy, handled byconfig::setup)- YAML file discovery and loading
- Figment env var merging (double-underscore nesting)
- Flat env overrides (single-underscore, K8s-friendly)
- Normalisation (infer implied settings)
§Errors
Returns a ConfigError if config loading or
deserialisation fails.