casconf v0.1.0 Casconf.Loader behaviour

Link to this section Summary

Functions

Loads and casts a specific configuration item

Finds Casconf.Config structs in the given term (lists, keyword lists and maps supported) and

Loads a specific configuration item

Returns the configured loaders in order of precedence

Link to this section Functions

Link to this function

load(config)

load(Casconf.Config.t()) :: {:ok, value :: term()} | {:error, reason :: term()}

Loads and casts a specific configuration item

It will raise the following errors:

  • Casconf.CastError (in case the supplied value couldn't be converted to the given data type)
  • Casconf.NoValueError (in case none of the loaders have found a value)
Link to this function

load_in(term)

load_in(term()) :: term()

Finds Casconf.Config structs in the given term (lists, keyword lists and maps supported) and

Link to this function

load_raw(config)

load_raw(Casconf.Config.t()) ::
  {:found, key :: term(), value :: term(), loader_name :: atom()}
  | {:error, reason :: term()}

Loads a specific configuration item

Returns the configured loaders in order of precedence

Link to this section Callbacks

Link to this callback

describe_load(term)

describe_load(term()) :: String.t()
Link to this callback

load(term)

load(term()) :: :not_found | {:found, term()} | {:error, reason :: term()}
Link to this callback

source_description(term)

source_description(term()) :: String.t()