Lamina.DSL (lamina v0.4.2)
Defines the macros used for building a configuration module.
Summary
Functions
Defines an individual configration parameter.
Defines an individual configration parameter.
Defines a provider for the configuration system.
Defines a provider for the configuration system.
Functions
@spec config(Lamina.config_key()) :: Macro.t()
Defines an individual configration parameter.
The same as config/2, except that no block is provided.
@spec config(Lamina.config_key(), [{:do, Macro.t()}]) :: Macro.t()
Defines an individual configration parameter.
Arguments:
config_key- the name of the new configuration parameter to define.block- a "do block" which will be evaluated in the context of theLamina.DSL.Configmodule.
Example
config :listen_port do
cast(&Lamina.Cast.to_integer/1)
validate(&is_integer/1)
end
Defines a provider for the configuration system.
The same as provider/2, however passes an empty list to the provider's
init/1 function.
Defines a provider for the configuration system.
Arguments:
module- the name of a module which implements theLamina.Providerbehaviour.options- a keyword list of options to be passed to the provider'sinit/1function.
Example
provider(Lamina.Provider.Env, prefix: "HTTP")