1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
//! # 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.
//!
//! ```no_run
//! use std::path::Path;
//! use svccat::{discovery, drift, manifest::Manifest};
//!
//! # fn main() -> anyhow::Result<()> {
//! 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());
//! # Ok(())
//! # }
//! ```
//!
//! ## 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.
// ── Stable public API (covered by semver) ──────────────────────────────────
// ── Internal: used by the `svccat` binary, not part of the stable library API.
// These remain `pub` so the binary crate can reach them, but they are hidden
// from the docs and may change in any release. ────────────────────────────