rdap-config 0.1.0

Configuration system for RDAPify (TOML + env overrides)
Documentation
  • Coverage
  • 81.08%
    60 out of 74 items documented1 out of 2 items with examples
  • Size
  • Source code size: 39.67 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 7.51 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 43s Average build duration of successful builds.
  • all releases: 43s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • vahmo

Configuration system for RDAPify.

Loads [RdapifyConfig] from a TOML file and environment variables, applies safe defaults for missing fields, and validates all values before returning.

Quick start

use rdap_config::load_config;

let config = load_config(None).expect("valid config");
println!("Timeout:    {}s",   config.rdap.timeout_seconds);
println!("Log level:  {:?}",  config.logging.level);
println!("Server:     {}:{}", config.server.host, config.server.port);

Config file search order

Priority Source
1 --config <path> CLI flag
2 $RDAPIFY_CONFIG
3 ./rdapify.toml
4 ~/.rdapify/rdapify.toml
5 /etc/rdapify/rdapify.toml

If no file is found, all-default configuration is used without error.

Environment variable overrides

Variable Config field
RDAPIFY_RDAP_TIMEOUT rdap.timeout_seconds
RDAPIFY_CACHE_TYPE cache.type
RDAPIFY_SQLITE_PATH sqlite.path
RDAPIFY_LICENSE_PATH license.path
RDAPIFY_LOG_LEVEL logging.level
RDAPIFY_LOG_FORMAT logging.format
RDAPIFY_METRICS_PORT metrics.port
RDAPIFY_SERVER_PORT server.port