#gateway #toml

cardinal-config

Configuration loader and validator for the Cardinal gateway

23 releases

new 0.2.39 Oct 27, 2025
0.2.38 Oct 25, 2025
0.2.23 Sep 30, 2025
0.1.0 Sep 26, 2025

#525 in Configuration

Download history 314/week @ 2025-09-24 848/week @ 2025-10-01 724/week @ 2025-10-08 581/week @ 2025-10-15 597/week @ 2025-10-22

2,819 downloads per month
Used in 5 crates (4 directly)

Apache-2.0

22KB
577 lines

cardinal-config

Configuration loader and validator for the gateway. It uses the config crate to merge sources, then maps them into strongly typed builders.

Features

  • Load from multiple TOML files and CARDINAL__... environment variables
  • Validate server address formats, whitelisted methods, and plugin references
  • Emit descriptive ConfigErrors when validation fails

API sketch

let paths = vec!["config/base.toml".into(), "config/local.toml".into()];
let cfg = cardinal_config::load_config(&paths)?;
assert_eq!(cfg.server.address, "127.0.0.1:1704");

CardinalConfigBuilder and friends remain available if you need to construct configs programmatically (e.g., tests or higher-level control planes).

Dependencies

~3.5–6.5MB
~137K SLoC