osproxy-config 1.0.1

Typed configuration load and validation. Produces validated value objects; no business logic.
Documentation
  • Coverage
  • 100%
    81 out of 81 items documented1 out of 20 items with examples
  • Size
  • Source code size: 61.75 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.2 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 3s Average build duration of successful builds.
  • all releases: 3s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • huyz0/opensearch-proxy
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • huyz0

Typed configuration.

Loads and fully validates configuration (file → environment → flags) before any socket opens, producing validated value objects the other crates consume (docs/01 §6). Invalid config fails fast with a typed, actionable [ConfigError] naming the bad field. It contains no business logic, it only turns strings into validated values; mapping those to domain types (the crypto provider, the pipeline) is the binary's job. Hot-reloadable state (directives, placement) goes through osproxy-control, not here.

Example

use osproxy_config::Config;
// Defaults apply when nothing is set; a bad value is a typed error.
let cfg = Config::resolve_for_test(&[("bind", "0.0.0.0:9000")]).unwrap();
assert_eq!(cfg.bind.port(), 9000);
assert!(cfg.require_tls_for_mutation, "enforced by default (NFR-S1)");
assert!(Config::resolve_for_test(&[("bind", "not-an-addr")]).is_err());