View Source Pow.Config (Pow v1.0.39)

Functions to parse and modify configurations.

Summary

Functions

Gets the key value from the configuration.

Merges two configurations.

Puts a new key value to the configuration.

Raise a ConfigError exception.

Retrieves the repo module from the config, or raises an exception.

Retrieves the user schema module from the config, or raises an exception.

Types

t()

@type t() :: Keyword.t()

Functions

get(config, key, default \\ nil)

@spec get(t(), atom(), any()) :: any()

Gets the key value from the configuration.

If not found, it'll fall back to environment config, and lastly to the default value which is nil if not specified.

merge(l_config, r_config)

@spec merge(t(), t()) :: t()

Merges two configurations.

put(config, key, value)

@spec put(t(), atom(), any()) :: t()

Puts a new key value to the configuration.

raise_error(message)

@spec raise_error(binary()) :: no_return()

Raise a ConfigError exception.

repo!(config)

@spec repo!(t()) :: atom()

Retrieves the repo module from the config, or raises an exception.

user!(config)

@spec user!(t()) :: atom()

Retrieves the user schema module from the config, or raises an exception.