Skip to main content

Crate svccat

Crate svccat 

Source
Expand description

§svccat

Detect drift between your declared service catalog and what actually lives in the repository.

svccat is primarily a command-line tool (the svccat binary), but its core engine is usable as a library. The typical flow is:

  1. Load the declared catalog with manifest::Manifest::load.
  2. Discover the services that actually exist on disk with discovery::discover_services.
  3. Compute drift between the two with drift::analyze, which returns a drift::DriftReport.
  4. Optionally render the report with the report module.
use std::path::Path;
use svccat::{discovery, drift, manifest::Manifest};

let root = Path::new(".");
let manifest = Manifest::load(&root.join("services.yaml"))?;
let discovered = discovery::discover_services(root, &manifest);
let report = drift::analyze(&manifest, &discovered, root);
println!("{} drift item(s)", report.drifts.len());

§API stability

Only the modules documented here are part of the stable, semver-covered public API: config, discovery, drift, manifest, and report. Every other module is an implementation detail of the svccat binary; such modules are hidden from these docs and may change in any release. See docs/API_STABILITY.md for the full policy.

Modules§

config
discovery
drift
manifest
report