Skogsrå v2.3.3 Skogsra.Env View Source

This module defines a Skogsra environment variable.

Link to this section Summary

Types

Application name.

Variable binding.

Variable binding list.

Key.

List of keys that lead to the value of the variable.

Variable namespace.

Environment variable options.

Environment variable options

t()

Skogsra environment variable.

Types.

Functions

Environment variable struct.

Gets the binding order for a Skogsra environment variable.

Whether the Skogsra environment variable is cached or not.

Gets the default value for a Skogsra environment variable.

Gets extra options.

Creates a new Skogsra environment variable.

Gets the OS variable name for the Skogsra environment variable.

Whether the Skogsra environment variable is required or not.

Gets the type of the Skogsra environment variable.

Link to this section Types

Specs

app_name() :: nil | atom()

Application name.

Specs

binding() :: :config | :system | module()

Variable binding.

Specs

bindings() :: [binding()]

Variable binding list.

Specs

key() :: atom()

Key.

Specs

keys() :: [key()]

List of keys that lead to the value of the variable.

Specs

namespace() :: nil | atom()

Variable namespace.

Specs

option() ::
  {:binding_order, bindings()}
  | {:binding_skip, bindings()}
  | {:os_env, binary()}
  | {:type, type()}
  | {:namespace, namespace()}
  | {:default, term()}
  | {:required, boolean()}
  | {:cached, boolean()}
  | {atom(), term()}

Environment variable options.

  • binding_order - Variable binding load order.
  • binding_skip - Skips loading a variable from the list of bindings.
  • os_env - The name of the OS environment variable.
  • type - Type to cast the OS environment variable value.
  • namespace - Default namespace for the variable.
  • default - Default value.
  • required - Whether the variable is required or not.
  • cached - Whether the variable is cached or not.

Specs

options() :: [option()]

Environment variable options:

Specs

t() :: %Skogsra.Env{
  app_name: app_name :: app_name(),
  keys: keys :: keys(),
  namespace: namespace :: namespace(),
  options: options :: options()
}

Skogsra environment variable.

Specs

type() ::
  :binary
  | :integer
  | :neg_integer
  | :non_neg_integer
  | :pos_integer
  | :float
  | :boolean
  | :atom
  | :module
  | :unsafe_module
  | :any
  | module()

Types.

Link to this section Functions

Environment variable struct.

Specs

binding_order(t()) :: bindings()

Gets the binding order for a Skogsra environment variable.

Specs

cached?(t()) :: boolean()

Whether the Skogsra environment variable is cached or not.

Specs

default(t()) :: term()

Gets the default value for a Skogsra environment variable.

Specs

extra_options(t()) :: keyword()

Gets extra options.

Link to this function

new(namespace, app_name, keys, options)

View Source

Specs

new(namespace(), app_name(), key(), options()) :: t()
new(namespace(), app_name(), keys(), options()) :: t()

Creates a new Skogsra environment variable.

Specs

os_env(t()) :: binary()

Gets the OS variable name for the Skogsra environment variable.

Specs

required?(t()) :: boolean()

Whether the Skogsra environment variable is required or not.

Specs

type(t()) :: type() | tuple()

Gets the type of the Skogsra environment variable.