1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/// This crate defines an attribute macro `#[settings(key = "xxx")]` to define settings to be
/// initialized when they are used.
/// 
/// Example:
///
/// ```rust
/// use lazy_settings::settings;
///
/// #[settings(key = "abcde")]
/// struct AbcdeSettings {
///   pub field_1: String,
/// }
/// ```
///
/// This will implement a `get(instance_name: &str)` method for `AbcdeSettings`, when `get(...)` is called, the settings
/// will be returned if it's initialized before. Otherwise the
/// fields are read from the environment variables in the following format. (Note that `abcde` is the key specified in the macro.)
///
/// `ALULU_APP_ABCDE_{instance_name.uppercase()}_{}` environment variables, where `{}` is the field names in upper case.
pub use lazy_settings_macros::settings;
pub use ::lazy_settings_macros;
pub use ::parking_lot;
pub use ::getset_scoped;
pub use ::config;
pub use ::serde;
pub use ::once_cell;
pub use ::eyre;

#[cfg(test)]
mod test {
    #[test]
    fn test_settings_macro() {
        let t = trybuild::TestCases::new();
        t.pass("tests/*.rs");
    }
}