This module defines an abstract data type conf()
which represents a set of configuration settings.
conf()s are immutable. You must create a
new conf() from an existing one; you cannot change
it.
| delete_value/2 | Deletes a value from a conf(). |
| dump/1 | Retrieves all values from a conf() as a list of
key-value pairs. |
| fold/3 | Creates a new term by applying a fun/3 (Key, Value, Acc)
to each key-value pair in the conf(). |
| get_string/2 | Retrieves a string from a conf(). |
| get_value/2 | Retrieves a value from a conf(). |
| load/1 | The configuration settings are loaded from the named config modules. |
| map/2 | Creates a new conf() by applying a fun/2 (Key, Value)
to each key-value pair in the conf(). |
| merge/2 | Creates a new conf() by merging two conf()s. |
| merge/3 | Creates a new conf() by merging two conf()s
and applying a fun/3 (Key, ValueA, ValueB) when there
are colliding keys. |
| new/0 | Creates a new conf(). |
| new/1 | Creates a new conf() from a list of key-value pairs. |
| put_value/3 | Updates a value in a conf(). |
delete_value(Key::key(), Conf::conf()) -> conf()
Deletes a value from a conf().
Returns a new conf().
dump(Conf::conf()) -> [{key(), value()}]
Retrieves all values from a conf() as a list of
key-value pairs.
fold(Fun::fun(), Acc::term(), Conf::conf()) -> term()
Creates a new term by applying a fun/3 (Key, Value, Acc)
to each key-value pair in the conf(). The return value of
the fun is a new accumulator.
get_string(Key::key(), Conf::conf()) -> string()
Retrieves a string from a conf(). The returned value
is always converted to a flattened string.
get_value(Key::key(), Conf::conf()) -> {ok, term()} | error
Retrieves a value from a conf().
load(ConfigModuleNames::[modulename()]) -> dict()
The configuration settings are loaded from the named config modules.
They are returned in a 'master dictionary' where the keys
are atoms (section names) and the values are conf()s.
map(Fun::fun(), Conf::conf()) -> conf()
Creates a new conf() by applying a fun/2 (Key, Value)
to each key-value pair in the conf(). The return value of the
fun is a new value to use for the key in the new conf().
merge(A::conf(), B::conf()) -> conf()
Creates a new conf() by merging two conf()s.
Mostly equivalent to merge(fun(K, V1, V2) -> V2 end, A, B),
except that cumulative settings are not wholly overridden, but rather,
accumulated.
merge(Fun::fun(), A::conf(), B::conf()) -> conf()
Creates a new conf() by merging two conf()s
and applying a fun/3 (Key, ValueA, ValueB) when there
are colliding keys. The return value of the fun is
the value which will be used in the new conf().
new() -> conf()
Creates a new conf().
new(List::[{key(), value()}]) -> conf()
Creates a new conf() from a list of key-value pairs.
put_value(Key::key(), Value::value(), Conf::conf()) -> conf()
Updates a value in a conf(). Returns a new
conf() with the specified key representing a new value.