View Source Runlet.Config (runlet v1.2.6)

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

Summary

Functions

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

Functions

Link to this function

get(app, key, default \\ nil)

View Source
@spec 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