Grouper.Config (Grouper v0.1.0) View Source

configuration functionality for groups

Link to this section Summary

Functions

delete configuration for a given key

get configuration for a given key

get all configuration as a keyword list

Used to load a specific application's environment. Not needed when running under an application, but useful for scripts and tests.

set configuration for a given key to a value

Used when running under an application to suppress loading the application config.

Link to this section Functions

Specs

del(Grouper.Data.key(), Grouper.Data.opts()) ::
  {:ok, Grouper.Data.value()} | {:error, :no_group}

delete configuration for a given key

Specs

get(Grouper.Data.key(), Grouper.Data.opts()) ::
  {:ok, Grouper.Data.value()} | {:error, :no_group}

get configuration for a given key

Specs

get_all(keyword()) :: {:ok, Grouper.Data.opts()} | {:error, :no_group}

get all configuration as a keyword list

Link to this function

load_otp_env(app \\ true, opts \\ [])

View Source

Specs

load_otp_env(Application.app(), Grouper.Data.opts()) :: :ok

Used to load a specific application's environment. Not needed when running under an application, but useful for scripts and tests.

NOTE: Will not load the environment if it's already been loaded or suppressed.

Link to this function

put(key, val, opts \\ [])

View Source

Specs

put(Grouper.Data.key(), Grouper.Data.value(), Grouper.Data.opts()) ::
  {:ok, Grouper.Data.value()} | {:error, :no_group}

set configuration for a given key to a value

Link to this function

suppress_otp_env(opts \\ [])

View Source

Specs

suppress_otp_env(Grouper.Data.opts()) :: :ok

Used when running under an application to suppress loading the application config.

NOTE: Will not suppress loading the environment if it's already been loaded. Must be called before anything attempts to read config to be effective.