View Source erf_conf (erf v0.1.2)
erf
's configuration manager module.
Summary
Functions
Clears the configuration for the given
Name
.Returns the configuration for the given
Name
.Returns the log level for the given
Name
.Returns the postprocess middlewares for the given
Name
.Returns the preprocess middlewares for the given
Name
.Returns a mapping between the routes and their matching RegEx for a given
Name
.Returns the router for the given
Name
.Returns the router module name for the given
Name
.Sets the configuration for the given
Name
.Types
-type t() :: #{callback => module(), log_level => logger:level(), preprocess_middlewares => [module()], postprocess_middlewares => [module()], route_patterns => erf:route_patterns(), router => erl_syntax:syntaxTree(), router_mod => module(), spec_path => binary(), spec_parser => module(), static_routes => [erf:static_route()], swagger_ui => boolean()}.
Functions
-spec clear(Name) -> Result when Name :: atom(), Result :: ok.
Name
.
-spec get(Name) -> Result when Name :: atom(), Result :: {ok, Conf} | {error, not_found}, Conf :: t().
Name
.
-spec log_level(Name) -> Result when Name :: atom(), Result :: {ok, LogLevel} | {error, not_found}, LogLevel :: logger:level().
Name
.
-spec postprocess_middlewares(Name) -> Result when Name :: atom(), Result :: {ok, PostprocessMiddlewares} | {error, not_found}, PostprocessMiddlewares :: [module()].
Name
.
-spec preprocess_middlewares(Name) -> Result when Name :: atom(), Result :: {ok, PreprocessMiddlewares} | {error, not_found}, PreprocessMiddlewares :: [module()].
Name
.
-spec route_patterns(Name) -> Result when Name :: atom(), Result :: {ok, RoutePatterns} | {error, not_found}, RoutePatterns :: erf:route_patterns().
Name
.
-spec router(Name) -> Result when Name :: atom(), Result :: {ok, Router} | {error, not_found}, Router :: erl_syntax:syntaxTree().
Name
.
-spec router_mod(Name) -> Result when Name :: atom(), Result :: {ok, RouterMod} | {error, not_found}, RouterMod :: module().
Name
.
Name
.