upload v0.1.0 Upload.Config

Link to this section Summary

Functions

Get a configuration variable, or raise an error

Get a configuration variable and fallback to the default

Link to this section Functions

Link to this function fetch!(config, key)
fetch!(list(), atom()) :: any() | no_return()

Get a configuration variable, or raise an error.

Examples

iex> Upload.Config.fetch!([foo: 1], :foo)
1

iex> Upload.Config.fetch!([foo: {:system, "FOOBAR"}], :foo)
nil

iex> Upload.Config.fetch!([], :foo)
** (KeyError) key :foo not found in: []
Link to this function get(config, key, default)
get(list(), atom(), any()) :: any()

Get a configuration variable and fallback to the default.

Examples

iex> Upload.Config.get([foo: 1], :foo, 3)
1

iex> Upload.Config.get([], :foo, 3)
3