ChangesetMerger v0.3.11 ChangesetMerger.Config View Source

Link to this section Summary

Functions

Provide a basic implemetation of a callback init when a configuration is read

Resolve the provided input. If the input is of the form ${}, then lookup the environment variable ““. If the value is nil, then raise an exception as your system appears to not be configured as expected

Link to this section Functions

Provide a basic implemetation of a callback init when a configuration is read.

The input is the provided configuration as stored in the application environment. The return value will be {:ok, config} with the updated list of configuration based on extracting any ${} environment variables.

This is useful, for example, when configuring your Ecto Repo for configuration values loaded at runtime.

Link to this macro invoke(piped_in_argument, expr) View Source (macro)

Resolve the provided input. If the input is of the form ${}, then lookup the environment variable ““. If the value is nil, then raise an exception as your system appears to not be configured as expected.

Examples

For regular inputs, just pass through the information

iex> ChangesetMerger.Config.resolve(1)
  1

  iex> ChangesetMerger.Config.resolve(:a)
  :a

  iex> ChangesetMerger.Config.resolve("b")
  "b"

  iex> ChangesetMerger.Config.resolve(["c", "d", "e"])
  ["c", "d", "e"]

  iex> ChangesetMerger.Config.resolve(%{c: "c", d: "d"})
  %{c: "c", d: "d"}