Lamina.DSL.Config.cast
You're seeing just the macro
cast
, go back to Lamina.DSL.Config module for more information.
Specs
Specify a transformation function to cast the value to the final required type.
Some configuration providers (most notably Env
) are only able to return
strings, so it can be necessary to modify them before they're returned to the
user.
Example
defmodule MyHttpServer.Config do
use Lamina
provider(Lamina.Provider.Env)
config :listen_port do
cast(&String.to_integer/1)
end
end