| Crates.io | mofa |
| lib.rs | mofa |
| version | 0.1.2 |
| created_at | 2024-12-27 16:09:54.103468+00 |
| updated_at | 2025-01-29 15:11:41.890478+00 |
| description | the config lib that merges options from anywhere |
| homepage | https://github.com/Kilerd/mofa |
| repository | |
| max_upload_size | |
| id | 1496476 |
| size | 37,345 |
${APP_KEY_NAME}${parent.sub.key_name}$ cargo add mofa
#[derive(Debug, Deserialize)]
struct Config {
original: String,
value: String,
}
fn main() {
let mut loader = ConfigLoader::new();
loader.add_source(FileSource::new("configuration/application.toml"));
loader.add_source(FileSource::new("configuration/application_database.toml"));
loader.add_source(EnvironmentSource::new("APP"));
loader.enable_environment_variable_processor();
loader.enable_path_variable_processor();
let config: Config = loader.construct()?;
}
Want to join us? Check out our "Contributing" guide and take a look at some of these issues:
This project is licensed under MIT license (LICENSE-MIT or [http://opensource.org/licenses/MIT]).