gleamunison/config

Types

pub type Config {
  Config(
    env: dict.Dict(String, ConfigValue),
    toml: dict.Dict(String, ConfigValue),
    cli: dict.Dict(String, ConfigValue),
  )
}

Constructors

pub type ConfigValue {
  StringVal(String)
  IntVal(Int)
  BoolVal(Bool)
}

Constructors

  • StringVal(String)
  • IntVal(Int)
  • BoolVal(Bool)

Values

pub fn get(
  config: Config,
  key: String,
) -> Result(ConfigValue, Nil)
pub fn get_bool(config: Config, key: String) -> Result(Bool, Nil)
pub fn get_int(config: Config, key: String) -> Result(Int, Nil)
pub fn get_string(
  config: Config,
  key: String,
) -> Result(String, Nil)
pub fn load() -> Config
pub fn with_cli(
  config: Config,
  overrides: dict.Dict(String, ConfigValue),
) -> Config
Search Document