Attribute Macro settings

Source
#[settings]
Expand description

This crate defines an attribute macro #[settings(key = "xxx")] to define settings to be initialized when they are used.

Example:

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.