Skogsrå v1.0.3 Skogsra.Settings View Source
Settings for Skogsra (only testing purposes).
Link to this section Summary
Functions
Changes Application
for a custom module (only for testing purposes)
Changes Application
for a custom module (only for testing purposes)
Changes System
for a custom module (only for testing purposes)
Changes System
for a custom module (only for testing purposes)
Link to this section Functions
Changes Application
for a custom module (only for testing purposes).
A call to Elixir.Skogsra.application_module()
will:
- If the OS environment variable is not
nil
, will return its casted value. - If the OS environment variable is
nil
, then it will try to get the value in the configuration file. - If the configuration file does not contain the value, will return the default value if it’s defined.
- If the default value is not defined and is not required, it will
return
nil
, otherwise it will error.
A call to Elixir.Skogsra.application_module(namespace)
will try
to do the same as before, but using a namespace (atom()
). This is
useful for separating the different configurations values for the same
variable.
The expected OS variable name can be obtained running the function
Elixir.Skogsra.application_module)(namespace, :system)
where
namespace can be either nil
or any namespace.
The expected configuration file can be obtained running the function
Elixir.Skogsra.application_module)(namespace, :config)
where
namespace can be either nil
or any namespace.
For testing purposes, the value can be reloaded at runtime with the
function Elixir.Skogsra.application_module)(namespace, :reload)
Changes Application
for a custom module (only for testing purposes).
Same as Elixir.Skogsra.application_module/0
but fails on error.
It can receive also a namespace when needed.
Changes System
for a custom module (only for testing purposes).
A call to Elixir.Skogsra.system_module()
will:
- If the OS environment variable is not
nil
, will return its casted value. - If the OS environment variable is
nil
, then it will try to get the value in the configuration file. - If the configuration file does not contain the value, will return the default value if it’s defined.
- If the default value is not defined and is not required, it will
return
nil
, otherwise it will error.
A call to Elixir.Skogsra.system_module(namespace)
will try
to do the same as before, but using a namespace (atom()
). This is
useful for separating the different configurations values for the same
variable.
The expected OS variable name can be obtained running the function
Elixir.Skogsra.system_module)(namespace, :system)
where
namespace can be either nil
or any namespace.
The expected configuration file can be obtained running the function
Elixir.Skogsra.system_module)(namespace, :config)
where
namespace can be either nil
or any namespace.
For testing purposes, the value can be reloaded at runtime with the
function Elixir.Skogsra.system_module)(namespace, :reload)
Changes System
for a custom module (only for testing purposes).
Same as Elixir.Skogsra.system_module/0
but fails on error.
It can receive also a namespace when needed.