Module app_helper

Function Index

get_env/1Retrieve all Key/Value pairs in the env for the specified app.
get_env/2The official way to get a value from the app's env.
get_env/3The official way to get a value from this application's env.
get_prop_or_env/3Retrieve value for Key from Properties if it exists, otherwise return from the application's env.
get_prop_or_env/4Return the value for Key in Properties if it exists, otherwise return the value from the application's env, or Default.
try_envs/1
try_envs/2Like get_env but try multiple {App, Key} combos before returning {default, Default}.

Function Details

get_env/1

get_env(App::atom()) -> [{Key::atom(), Value::term()}]

Retrieve all Key/Value pairs in the env for the specified app.

get_env/2

get_env(App::atom(), Key::atom()) -> term()

The official way to get a value from the app's env. Will return the 'undefined' atom if that key is unset.

get_env/3

get_env(App::atom(), Key::atom(), Default::term()) -> term()

The official way to get a value from this application's env. Will return Default if that key is unset.

get_prop_or_env/3

get_prop_or_env(Key::atom(), Properties::[{atom(), term()}], App::atom()) -> term()

Retrieve value for Key from Properties if it exists, otherwise return from the application's env.

get_prop_or_env/4

get_prop_or_env(Key::atom(), Properties::[{atom(), term()}], App::atom(), Default::term()) -> term()

Return the value for Key in Properties if it exists, otherwise return the value from the application's env, or Default.

try_envs/1

try_envs(Pairs) -> any()

try_envs/2

try_envs(T::[{atom(), atom()}], Default::term()) -> {atom(), atom(), term()}

Like get_env but try multiple {App, Key} combos before returning {default, Default}. The return value is {App, Key, Value} so that the caller may distinguish where the value came from. This is useful for scenarios when the config app/key has changed between releases and you need to check for both.


Generated by EDoc