pub struct Config {
pub server: ServerCfg,
pub auth: AuthCfg,
pub ratelimit: RateLimitCfg,
pub validation: ValidationCfg,
pub headers: HeadersCfg,
pub tls: TlsCfg,
pub waf: WafCfg,
pub control_plane: ControlPlaneCfg,
}Fields§
§server: ServerCfg§auth: AuthCfg§ratelimit: RateLimitCfg§validation: ValidationCfg§headers: HeadersCfg§tls: TlsCfg§waf: WafCfg§control_plane: ControlPlaneCfgOptional “managed mode”: pull policy from / report usage to a remote control plane. Off by default; the edge is a standalone proxy unless this is configured.
Implementations§
Source§impl Config
impl Config
Sourcepub fn load(path: Option<&str>) -> Result<Config>
pub fn load(path: Option<&str>) -> Result<Config>
Load defaults, overlay an optional TOML file, then apply env overrides.
Sourcepub fn with_policy_from(&self, policy_toml: &str) -> Result<Config>
pub fn with_policy_from(&self, policy_toml: &str) -> Result<Config>
Produce an effective config by overlaying a control-plane-pushed policy document onto
this (local) config: the policy sections (auth/ratelimit/validation/headers/waf)
come from the pushed TOML; server/tls/control_plane stay local (the control plane
manages security policy, not this edge’s listener/plumbing). The result feeds the normal
build_runtime + hot-swap path, so a malformed policy is rejected like any bad reload.
Sourcepub fn upstream_base(&self) -> String
pub fn upstream_base(&self) -> String
The upstream base URL EdgeGuard forwards to, e.g. “http://127.0.0.1:3000”.
Sourcepub fn upstream_probe_addr(&self) -> Option<(String, u16)>
pub fn upstream_probe_addr(&self) -> Option<(String, u16)>
The (host, port) EdgeGuard probes for readiness, mirroring Self::upstream_base:
co-process mode probes 127.0.0.1:app_port; an explicit upstream URL is parsed,
defaulting the port from the scheme. Returns None if the URL carries no usable
host, so the readiness check reports “not ready” rather than panicking.