cfgmatic 5.0.1

Facade crate for cfgmatic configuration management framework
Documentation

cfgmatic

Facade crate for the cfgmatic workspace.

cfgmatic re-exports the primary surface for:

  • path discovery via cfgmatic::paths;
  • source loading and LoadReport via cfgmatic::source;
  • explainable merge via cfgmatic::merge;
  • optional schema/introspection via cfgmatic::schema;
  • optional plan and reactive workflows.

Installation

[dependencies]
cfgmatic = { version = "5", features = ["schema"] }

Features

Feature Description Default
source Source loading and layering Yes
plan Plan/apply workflow Yes
reactive Runtime subscriptions No
schema Re-export cfgmatic-schema and schema-aware diagnostics No

Canonical example

use cfgmatic::source::prelude::*;

let defaults = MemorySource::from_json(serde_json::json!({
    "server": { "port": 8080 }
}));
let overrides = MemorySource::from_json(serde_json::json!({
    "server": { "port": 9090 }
}));

let mut coordinator = SourceCoordinator::builder()
    .add_source(defaults, 1)
    .add_source(overrides, 10)
    .build();

let report = coordinator.load_report()?;
let explanation = report.merge_report.explain_path("/server/port").unwrap();

assert_eq!(explanation.winner.unwrap().source, "memory");
# Ok::<(), cfgmatic::source::SourceError>(())

License

MIT OR Apache-2.0