kalgan_config

Crates.iokalgan_config
lib.rskalgan_config
version0.9.1
sourcesrc
created_at2022-02-20 16:50:56.579894
updated_at2022-02-24 14:30:37.067657
descriptionCollection of functions to retrieve data and settings parameters defined in yaml files used by Kalgan Framework.
homepagehttps://kalgan.eduardocasas.com
repositoryhttps://github.com/eduardocasas/kalgan-config
max_upload_size
id535832
size13,384
Eduardo Casas (eduardocasas)

documentation

README

kalgan-config

Collection of functions to retrieve data and settings parameters defined in yaml files used by Kalgan Framework.

Examples

This is the yaml file to be used in the following tests:

## tests/settings.yaml

user:
  name: John
  is_real: false
  age: 39
  height: 1.78
  children:
    - Huey
    - Dewey
    - Louie
use kalgan_config::Config;

let config: Config = Config::new("tests/settings.yaml");
assert_eq!(config.get("user.name").unwrap(), "John");
assert_eq!(config.get_string("user.name").unwrap(), "John".to_string());
assert_eq!(config.get_bool("user.is_real").unwrap(), false);
assert_eq!(config.get_number("user.age").unwrap(), 39);
assert_eq!(config.get_float("user.height").unwrap(), 1.78);
assert_eq!(config.get_vec("user.children").unwrap(), vec!["Huey", "Dewey", "Louie"]);

Documentation

For further information please visit:

License

This crate is licensed under either of the following licenses:

Commit count: 9

cargo fmt