View Source Mahaul.Helpers (Mahaul v0.5.0)
Basic helpers for parsing and validating the system environment variables.
Link to this section Summary
Functions
Returns a valid parsed environment variable value or nil
.
Returns a list of parsed environment variable values.
Validates the list of parsed environment variables.
Validates and throws error for invalid environment variables.
Validates the initialization options.
Link to this section Functions
@spec get_env( atom(), keyword() ) :: Mahaul.Constants.value_type()
Returns a valid parsed environment variable value or nil
.
@spec parse_all(Mahaul.Constants.config_type()) :: Mahaul.Constants.normalized_values_type()
Returns a list of parsed environment variable values.
@spec validate(Mahaul.Constants.normalized_values_type()) :: {:ok} | {:error, binary()}
Validates the list of parsed environment variables.
Given a list of parsed environment variables, the method validates the list to contain all valid environment variables. For any invalid values, the method logs the name of the missing environment variable and returns the list of errors.
@spec validate!(Mahaul.Constants.normalized_values_type()) :: nil
Validates and throws error for invalid environment variables.
Same as validate/1
, except that it raises exception on error.
@spec validate_opts!(keyword()) :: :ok
Validates the initialization options.