View Source JetExt.Config.Env (jet_ext v0.2.4)
This module is used to get environment variables.
The most common use case is to import this module in config files.
Example
# runtime.exs
import Config
import JetExt.Config.Env
config :some_app,
string: fetch_string!("STRING_ENV"),
integer: fetch_integer!("INTEGER_ENV")
Summary
Functions
Casts an environment variable to a boolean.
Fetches an environment variable and parses it to an integer.
Fetches an environment variable and returns it as a string.
Types
Functions
Casts an environment variable to a boolean.
Any string except "false"
and "0"
will be cast to true
.
Here are some truthy values: "true"
, "1"
, "yes"
, "on"
.
Fetches an environment variable and parses it to an integer.
Options:
- default: the default value to return if the environment variable is missing
- hint: a hint to be used in the error message,
it can contain
%{name}
which will be replaced by the environment variable name
Fetches an environment variable and returns it as a string.
Options:
- default: the default value to return if the environment variable is missing
- hint: a hint to be used in the error message,
it can contain
%{name}
which will be replaced by the environment variable name