pub struct Config {
pub port: u16,
pub bind_addr: Option<IpAddr>,
pub database_url: Option<String>,
pub redis_url: Option<String>,
pub sentry_dsn: Option<String>,
pub master_key: Option<String>,
}Expand description
Gateway runtime configuration.
All fields are populated by Config::from_env. Fields are intentionally
public so handlers can read them directly; adding a setter would just be
noise.
Fields§
§port: u16TCP port the gateway binds. Defaults to 8080.
bind_addr: Option<IpAddr>IP address the gateway binds (TT_BIND_ADDR). None when unset —
the gateway then picks a default based on whether a key store is
configured (0.0.0.0 with one, loopback without).
database_url: Option<String>Postgres connection string. None disables persistence at boot.
redis_url: Option<String>Redis URL for the L1 exact-match cache. None disables L1.
sentry_dsn: Option<String>Sentry DSN for error reporting. None disables Sentry init.
master_key: Option<String>Hex-encoded XChaCha20-Poly1305 root key for provider credentials at rest. Read by the auth/cred layer when it lands; surfaced here so the gateway fails fast at boot if production has it misconfigured.
Implementations§
Source§impl Config
impl Config
Sourcepub fn from_env() -> Result<Self, ConfigError>
pub fn from_env() -> Result<Self, ConfigError>
Load from env. Defaults port to 8080 when PORT is unset.
§Errors
ConfigError::Parse when PORT is set to a non-integer.