config-rs
config-rs copied to clipboard
⚙️ Layered configuration system for Rust applications (with strong support for 12-factor applications).
``` let mut builder = Config::builder() .add_source(File::with_name(&config_path).format(FileFormat::Json).required(false)) .add_source(Environment::default().prefix("CONFIG").prefix_separator("_").separator("__").convert_case(Case::UpperCamel)); ``` If the file contains: ``` Otel { Endpoint: "FROM FILE" } ``` And the environment variable "CONFIG_OTEL__ENDPOINT" equals "FROM ENV" getting...
Coming from a Spring background, I'm missing the possibility of expansion of environment variables referenced from within configuration files, giving an even more flexible approach next to overriding properties which...
Allow to nest with single `_` even when field names contain underscores via `.underscore_nesting(true)``. Can be used when field names also have `_` with environment overrides. Can be used as...
I've tried searching the issue tracker for similar issues but surprisingly it seems no one has run into this so far. Parts of my configuration is dynamic, I wanted to...
I'm working on feature control library and would like to take dependency on Value and path::Expression. Unfortunately, path::Expression is not public module. It is useful even outside the context of...
To support #648
Related issue #648
Not quite sure whether to considering removing these to be a breaking change or not.
Can it support eon? [eon](https://github.com/emilk/eon)
I've noticed that `.add_source(config::File::with_name(".env"))` does not work because .env "is not of a registered file format" I think this library should support reading .env files, as well as `.env.prod`, etc.....