runlet v1.0.0 Runlet.Config

This module handles fetching values from the config with some additional niceties

Link to this section Summary

Functions

Fetches a value from the config, or from the environment if {:system, "VAR"} is provided.

Link to this section Functions

Link to this function

get(app, key, default \\ nil)

get(atom(), atom(), term() | nil) :: term()

Fetches a value from the config, or from the environment if {:system, "VAR"} is provided.

An optional default value can be provided if desired.

Example

iex> Application.put_env(:myapp, :test_var2, 1)
...> 1 = Elixir.Runlet.Config.get(:myapp, :test_var2)
1

iex> :default = Elixir.Runlet.Config.get(:myapp, :missing_var, :default)
:default