View Source Yggdrasil.Config (Yggdrasil v6.0.2)
This module defines the available config variables for Yggdrasil.
Link to this section Summary
Functions
Module registry.
Module registry.
Preloads all variables in a namespace
if supplied.
Yggdrasil publisher options. These options are for :poolboy
.
Yggdrasil publisher options. These options are for :poolboy
.
Puts the value
to Yggdrasil.Config.module_registry/0
. Optionally, receives
the namespace
.
Puts the value
to Yggdrasil.Config.publisher_options/0
. Optionally, receives
the namespace
.
Reloads the value for Yggdrasil.Config.module_registry/0
. Optionally, receives
the namespace
for the variable.
Reloads the value for Yggdrasil.Config.publisher_options/0
. Optionally, receives
the namespace
for the variable.
Creates a template for OS environment variables given a filename
.
Additionally, it can receive a list of options
Validates that all required variables are present.
Returns :ok
if they are, {:error, errors}
if they are not. errors
will be a list of all errors encountered while getting required variables.
Validates that all required variables are present.
Returns :ok
if they are, raises if they're not.
Link to this section Functions
Specs
module_registry(Skogsra.Env.namespace()) :: {:ok, atom()} | {:error, binary()}
Module registry.
iex> Yggdrasil.Config.module_registry!()
:"$yggdrasil_registry"
Calling Yggdrasil.Config.module_registry()
will ensure the following:
- Binding order: [:config]
- OS environment variable: ""
- Type: :atom
- Default: :"$yggdrasil_registry"
- Required: false
- Cached: true
Specs
module_registry!(Skogsra.Env.namespace()) :: atom() | no_return()
Module registry.
iex> Yggdrasil.Config.module_registry!()
:"$yggdrasil_registry"
Bang version of Yggdrasil.Config.module_registry/0
(fails on error). Optionally,
receives the namespace
for the variable.
Specs
preload(Skogsra.Env.namespace()) :: :ok
Preloads all variables in a namespace
if supplied.
Specs
publisher_options(Skogsra.Env.namespace()) :: {:ok, any()} | {:error, binary()}
Yggdrasil publisher options. These options are for :poolboy
.
iex> Yggdrasil.Config.publisher_options!()
[size: 1, max_overflow: 5]
Calling Yggdrasil.Config.publisher_options()
will ensure the following:
- Binding order: [:config]
- OS environment variable: ""
- Type: :any
- Default: [size: 1, max_overflow: 5]
- Required: false
- Cached: true
Specs
publisher_options!(Skogsra.Env.namespace()) :: any() | no_return()
Yggdrasil publisher options. These options are for :poolboy
.
iex> Yggdrasil.Config.publisher_options!()
[size: 1, max_overflow: 5]
Bang version of Yggdrasil.Config.publisher_options/0
(fails on error). Optionally,
receives the namespace
for the variable.
Specs
put_module_registry(atom(), Skogsra.Env.namespace()) :: :ok | {:error, binary()}
Puts the value
to Yggdrasil.Config.module_registry/0
. Optionally, receives
the namespace
.
Specs
put_publisher_options(any(), Skogsra.Env.namespace()) :: :ok | {:error, binary()}
Puts the value
to Yggdrasil.Config.publisher_options/0
. Optionally, receives
the namespace
.
Specs
reload_module_registry(Skogsra.Env.namespace()) :: {:ok, atom()} | {:error, binary()}
Reloads the value for Yggdrasil.Config.module_registry/0
. Optionally, receives
the namespace
for the variable.
Specs
reload_publisher_options(Skogsra.Env.namespace()) :: {:ok, any()} | {:error, binary()}
Reloads the value for Yggdrasil.Config.publisher_options/0
. Optionally, receives
the namespace
for the variable.
Specs
template( Path.t(), keyword() ) :: :ok | {:error, File.posix()}
Creates a template for OS environment variables given a filename
.
Additionally, it can receive a list of options:
type
: What kind of file it will generate (:elixir
,:unix
,:windows
).namespace
: Namespace for the variables.
Specs
validate(Skogsra.Env.namespace()) :: :ok | {:error, [binary()]}
Validates that all required variables are present.
Returns :ok
if they are, {:error, errors}
if they are not. errors
will be a list of all errors encountered while getting required variables.
It is possible to provide a namespace
as argument (defaults to nil
).
Specs
validate!(Skogsra.Env.namespace()) :: :ok | no_return()
Validates that all required variables are present.
Returns :ok
if they are, raises if they're not.
It is possible to provide a namespace
as argument (defaults to nil
).