View Source Kloak.Utils (kloak v0.1.0)
Utility module which offers some functionality for other modules.
Summary
Functions
Fetches and retruns a setting fetched under the given key or path.
When the setting was not found under the given key/path, the given default value is returned.
According to Application.compile_env/3
and Application.compile_env!/2
it's possible to provide a key or a path of keys to fetch a setting.
Fetches and retruns a setting fetched under the given key or path.
When the setting was not found under the given key/path, an ArgumentError will be raised.
According to Application.compile_env/3
and Application.compile_env!/2
it's possible to provide a key or a path of keys to fetch a setting.
Functions
Fetches and retruns a setting fetched under the given key or path.
When the setting was not found under the given key/path, the given default value is returned.
According to Application.compile_env/3
and Application.compile_env!/2
it's possible to provide a key or a path of keys to fetch a setting.
Examples
iex> fetch_env(:keymaster, [:key_1, :key_2, :key_3])
"value3"
iex> fetch_env(:keymaster, [:key_1, :key_2, :key_3], "default")
"default"
iex> fetch_env(:keymaster, :other_key)
"other_value"
Fetches and retruns a setting fetched under the given key or path.
When the setting was not found under the given key/path, an ArgumentError will be raised.
According to Application.compile_env/3
and Application.compile_env!/2
it's possible to provide a key or a path of keys to fetch a setting.
Examples
iex> fetch_env!(:keymaster, [:key_1, :key_2, :key_3])
"value3"
iex> fetch_env!(:keymaster, [:key_1, :key_2, :key_3])
ArgumentError
iex> fetch_env(:keymaster, :other_key)
"other_value"