confy v0.3.0 Confy.Schema View Source
Functions that can be used inside Confy.defconfig/2.
Link to this section Summary
Functions
Specifies a field that is part of the configuration struct.
Link to this section Functions
Link to this macro
field(name, parser, options \\ []) View Source (macro)
Specifies a field that is part of the configuration struct.
Can/should only be called inside a call to Confy.defconfig.
nameshould be an atom representing the field. It will also become the field name for the struct that is created.parsershould either be:- an arity-one function reference like
&YourModule.some_type_parser/1. - An atom representing one of the common parser function names in
Confy.Parserslike:integer,:string,:booleanor:term.
- an arity-one function reference like
Supported field options are:
default:, supplies a default value to this field. If not set, the configuration field is set to be required.
You are highly encouraged to add a @documentation text above each and every field;
these will be added to the configuration's module documentation.