tt-config 0.1.0

Layered config loader: defaults < file (yaml/toml) < env vars.
Documentation
  • Coverage
  • 100%
    14 out of 14 items documented1 out of 4 items with examples
  • Size
  • Source code size: 11.29 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 371.63 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 8s Average build duration of successful builds.
  • all releases: 8s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • TokenTrimmer/tokentrimmer
    1 0 2
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • iancsimon

Layered configuration loader.

Minimal env-var loader for the Gateway. Adds layered file (yaml/toml) and CLI-flag merging in later iterations when those callers exist.

Reading

use tt_config::Config;
let cfg = Config::from_env().expect("env vars valid");

Conventions

  • Required vars return [ConfigError::Missing] when absent.
  • Optional vars return None when absent and Some(_) when present.
  • Parse failures (e.g. PORT="abc") return [ConfigError::Parse].