cardinal-config

Crates.iocardinal-config
lib.rscardinal-config
version0.1.0
created_at2025-09-26 00:25:51.708072+00
updated_at2025-09-26 00:25:51.708072+00
descriptionConfiguration loader and validator for the Cardinal gateway
homepagehttps://github.com/andrespirela/cardinal
repositoryhttps://github.com/andrespirela/cardinal
max_upload_size
id1855258
size27,353
(andreespirela)

documentation

README

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).

Commit count: 0

cargo fmt