Module cuttlefish_generator

Function Index

add_defaults/2adds default values from the schema when something's not defined in the Conf, to give a complete app.config.
find_mapping/2
map/2
map/3
minimal_map/2Generates an Erlang config that only includes the settings encompassed by the passed Config, excluding defaults from the schema for unspecified settings.
resolve_aliases/2Resolves alias keys to their canonical keys.
validate/2Validates the configuration against the schema by running all pipeline phases and collecting errors from each, rather than stopping at the first failing phase.
validate/3

Function Details

add_defaults/2

add_defaults(Conf, Mappings) -> any()

adds default values from the schema when something's not defined in the Conf, to give a complete app.config

find_mapping/2

find_mapping(Variable, Mappings) -> any()

map/2

map(Schema::cuttlefish_schema:schema(), Config::cuttlefish_conf:conf()) -> [proplists:property()] | {error, atom(), cuttlefish_error:errorlist()}

map/3

map(Schema::cuttlefish_schema:schema(), Config::cuttlefish_conf:conf(), ParsedArgs::[proplists:property()]) -> [proplists:property()] | {error, atom(), cuttlefish_error:errorlist()}

minimal_map/2

minimal_map(X1::cuttlefish_schema:schema(), Config::cuttlefish_conf:conf()) -> [proplists:property()] | {error, atom(), cuttlefish_error:errorlist()}

Generates an Erlang config that only includes the settings encompassed by the passed Config, excluding defaults from the schema for unspecified settings.

resolve_aliases/2

resolve_aliases(Conf::cuttlefish_conf:conf(), Mappings::[cuttlefish_mapping:mapping()]) -> cuttlefish_conf:conf()

Resolves alias keys to their canonical keys. Alias values are rewritten to the canonical key with a deprecation warning. Canonical takes precedence. If multiple aliases are set, the first one listed in the mapping's aliases property wins. Every set alias warns. If the alias carries a custom message, it is appended to the warning.

validate/2

validate(Schema::cuttlefish_schema:schema(), Config::cuttlefish_conf:conf()) -> ok | {error, cuttlefish_error:errorlist()}

Validates the configuration against the schema by running all pipeline phases and collecting errors from each, rather than stopping at the first failing phase. Does not write any files.

validate/3

validate(Schema::cuttlefish_schema:schema(), Config::cuttlefish_conf:conf(), ParsedArgs::[proplists:property()]) -> ok | {error, cuttlefish_error:errorlist()}


Generated by EDoc