Reads and checks .juggernaut.exs (see the configuration guide).
Checked in this order, each failure a config error naming the file:
- the file evaluates (syntax errors, raises, throws and exits are reported, never crash the task);
- the result is a keyword list;
- no key is given twice, at the top level or inside a nested group (checked before
NimbleOptions, whose message for that case is
unknown options); - NimbleOptions validation: unknown keys reported together, nested errors with their path.
Summary
Functions
Checks an evaluated config term and validates it against the schema.
A config error whose message names the config file.
The config file name, relative to the project root.
Reads the config of the project at root: {:ok, options, path} with defaults filled
(path is nil when there is no file), or a config error.
Evaluates path; a missing file is an empty keyword list.
Functions
@spec check(term()) :: {:ok, keyword()} | {:error, Juggernaut.Error.t()}
Checks an evaluated config term and validates it against the schema.
@spec error(String.t(), map()) :: Juggernaut.Error.t()
A config error whose message names the config file.
@spec file_name() :: String.t()
The config file name, relative to the project root.
@spec load(Path.t()) :: {:ok, keyword(), Path.t() | nil} | {:error, Juggernaut.Error.t()}
Reads the config of the project at root: {:ok, options, path} with defaults filled
(path is nil when there is no file), or a config error.
@spec read(Path.t()) :: {:ok, term()} | {:error, Juggernaut.Error.t()}
Evaluates path; a missing file is an empty keyword list.