confik 0.14.0

A library for reading application configuration split across multiple sources
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use confik::{common::DatabaseConnectionConfig, Configuration, TomlSource};

#[test]
fn database_config() {
    let toml = r#"
database = "postgres"
username = "user"
password = "password"
path = "abc"
    "#;
    let config = DatabaseConnectionConfig::builder()
        .override_with(TomlSource::new(toml).allow_secrets())
        .try_build()
        .unwrap();
    assert_eq!(config.to_string(), "postgres://user:password@abc");
}