BootEnv v0.1.1 BootEnv View Source

Configuration provider to load and validate immutable application configs during boot process

Link to this section Summary

Functions

Macro to declare configuration scope, can be nested and can contain env/2 expressions

Macro to declare configuration parameter and validation code for it (should be boolean expression)

Link to this section Functions

Link to this macro

conf(key_ast, list) View Source (macro)

Macro to declare configuration scope, can be nested and can contain env/2 expressions

Example

conf :my_app do
  env foo, do: is_integer(foo)
  env bar, do: is_integer(bar)

  conf MyApp.Repo do
    env host, do: String.valid?(host)
  end
end
Link to this macro

env(param, list) View Source (macro)

Macro to declare configuration parameter and validation code for it (should be boolean expression)

Example

env host do
  String.valid?(host) and (host != "")
end