diff options
| author | tv <tv@krebsco.de> | 2026-11-29 01:12:18 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-29 01:12:18 +0000 |
| commit | f10ee79ddc2b0a541f1011aa395990df21e456b5 (patch) | |
| tree | c88be3f95cbec1d5413c2b1aa5c3c9ff7135b6f3 /crates/config/src/lib.rs | |
| parent | 7a8e8ecd650ddb253c08445f6f60686e1c8b8bf5 (diff) | |
config: files, arguments and layers, by a program's own options
What reads a configuration moves to the crate config, as it was, so
that other programs read theirs alike:
* option: Kind, OptionSpec, and Schema: a program's options, those
that can't be combined, and those that are gone;
* file: TOML and JSON files, their includes and unsets;
* arguments: the options as arguments, --config and --unset, and files
and arguments put together (merged);
* layer: values and where they came from, a later source over the
earlier ones (overlay), what a value was made of (Sources);
* units: durations and sizes as operators write them, which continuum
keeps under crate::units.
Each takes the schema it reads by, where continuum's code went by its
own tables: the node's is config::SCHEMA, a party's client's
config::PARTY. Whether a value is shown goes by the schema read by, so
an option of the node is no secret for being one of the client's.
continuum keeps its options, the settings they make, their checks and
the report; its tests of files and layers stay, by the node's options,
and the crate has one by a schema of its own.
Diffstat (limited to 'crates/config/src/lib.rs')
| -rw-r--r-- | crates/config/src/lib.rs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/crates/config/src/lib.rs b/crates/config/src/lib.rs index 654c475..fe2432e 100644 --- a/crates/config/src/lib.rs +++ b/crates/config/src/lib.rs @@ -1,6 +1,19 @@ //! What a program's configuration is made of, from its files and its arguments: a //! library, which continuum's configuration is made with, and other programs' may be. //! -//! * [`import`]: values taken from elsewhere instead of written out. +//! * [`option`]: the options a program takes, described once (`Schema`); +//! * [`file`]: configuration files, TOML or JSON, including others; +//! * [`arguments`]: the command line, and files and arguments put together; +//! * [`layer`]: values and where they came from, later sources over earlier ones; +//! * [`import`]: values taken from elsewhere instead of written out; +//! * [`units`]: durations and sizes as operators write them. +pub mod arguments; +pub mod file; pub mod import; +pub mod layer; +pub mod option; +pub mod units; + +#[cfg(test)] +mod testing; |
