Skip to main content

Module config

Module config 

Source
Expand description

Per-environment application configuration loaded from config/<env>.yml.

Config is a trait so applications can supply their own backing store; YamlConfig is the default implementation that deserializes the YAML file for the environment reported by Environment::get_env.

Structs§

CorsConfig
Opt-in CORS settings (spec 07 [middleware.cors]). Disabled unless enabled: true. Each dimension must be configured explicitly: empty lists deny that dimension. Use "*" in a list to allow any value for that dimension. With allow_credentials: true, origin/method/header wildcards use mirror-request semantics instead of * (required by the CORS spec and tower-http).
LoggerConfig
Re-exported so config::LoggerConfig resolves; the logger config lives in doido-core alongside the logger it drives. Logging settings, deserialized from the logger section of config/<env>.yml.
MiddlewareConfig
Opt-in middleware settings (spec 07 [middleware]).
ServerConfig
Server bind settings. The listen address is the bind IP joined with port (e.g. 0.0.0.0:3000).
YamlConfig
File-based Config deserialized from config/<env>.yml.

Traits§

Config
Application configuration. Used as a trait object (Box<dyn Config>) so the backing store can be swapped without touching call sites.

Functions§

load
Loads the current environment’s configuration as a trait object, falling back to Default values when the file is missing or invalid.