EnvConf.Server
The EnvConf Server is the main config service. It provides a few functions for getting and setting Config Values.
The current behavior for setting values requires that both the key and value be binaries. However there are get functions that will return a value of a specific type.
Summary
| get(key) | get takes a binary key value. It returns the binary stored in the system environment at that key |
| get_atom(key) | get_atom takes a binary key value. It returns the result of calling String.to_atom on the binary stored in the system environment at the given key |
| get_boolean(key) | get_boolean takes a binary key value. If the value of that environment key is “false” or “FALSE” then it returns false. If the value of that environment key is “true” or “TRUE” then it returns true |
| get_number(key) | get_number takes a binary key value. It returns the result of calling String.to_integer on the binary stored in the system environment at that key |
| set(dict) | Translate the given HashDict to the system environment. Keys map to environment variables and values map to values |
| set(key, value) | Set the environment variable specified by key to the binary version of value |
| start_link(defaults \\ []) |
Functions
get takes a binary key value. It returns the binary stored in the system environment at that key.
get_atom takes a binary key value. It returns the result of calling String.to_atom on the binary stored in the system environment at the given key.
get_boolean takes a binary key value. If the value of that environment key is “false” or “FALSE” then it returns false. If the value of that environment key is “true” or “TRUE” then it returns true.
get_number takes a binary key value. It returns the result of calling String.to_integer on the binary stored in the system environment at that key.
Translate the given HashDict to the system environment. Keys map to environment variables and values map to values.
Set the environment variable specified by key to the binary version of value.