pub struct GatewayConfig {
pub mode: DeploymentMode,
pub local: LocalModeConfig,
pub remote: RemoteModeConfig,
pub agent: AgentConnectConfig,
pub storage: StorageConfig,
}Expand description
Top-level gateway configuration loaded at startup.
Composes the four sub-configs and a DeploymentMode flag. All
fields use #[serde(default)] so a minimal YAML — even an empty
document — deserialises into the documented defaults.
Fields§
§mode: DeploymentModeWhich topology to boot — local-dev or remote control-plane.
local: LocalModeConfigSettings for mode = Local.
remote: RemoteModeConfigSettings for mode = Remote.
agent: AgentConnectConfigSettings the SDK FFI shim reads to dial the gateway.
storage: StorageConfigDurable-persistence configuration (Epic 18 — AAASM-1569).
Implementations§
Source§impl GatewayConfig
impl GatewayConfig
Sourcepub fn expand_paths(&mut self)
pub fn expand_paths(&mut self)
Expand a leading ~ in every path field to the user’s home directory.
Touches local.storage_path and both remote.tls paths.
A no-op when the home directory cannot be resolved or when
no field starts with ~. Idempotent — calling twice produces
the same result as calling once.
Source§impl GatewayConfig
impl GatewayConfig
Sourcepub fn apply_env_overrides(&mut self) -> Result<(), ConfigError>
pub fn apply_env_overrides(&mut self) -> Result<(), ConfigError>
Apply the documented AA_MODE / AAASM_* environment variables
on top of self, overriding any fields they set.
Returns ConfigError::InvalidMode / ConfigError::InvalidPort
when an env var has been set to a value that cannot be parsed.
Source§impl GatewayConfig
impl GatewayConfig
Sourcepub fn validate(&self) -> Result<(), ConfigError>
pub fn validate(&self) -> Result<(), ConfigError>
Validate the fully-loaded config — call this after
expand_paths and
apply_env_overrides so values
coming in from env vars are included in the checks.
Currently enforces two storage-retention invariants from E18 S-H (AAASM-1582):
storage.retention.cold_action = archiverequiresstorage.retention.archive_urlto be set (in YAML or by env var) — returnsConfigError::ArchiveUrlRequired.storage.retention.warm_daysmust be strictly greater thanstorage.retention.hot_days— returnsConfigError::WarmDaysNotGreaterThanHotDays.
Source§impl GatewayConfig
impl GatewayConfig
Sourcepub fn resolve_storage_backend(&mut self)
pub fn resolve_storage_backend(&mut self)
Infer storage.backend from mode when it was not explicitly
set in YAML or via the AAASM_STORAGE_BACKEND env var.
mode: Local→storage.backend = Sqlitemode: Remote→storage.backend = Postgres
No-op when the operator explicitly set storage.backend in
YAML or via AAASM_STORAGE_BACKEND — their choice always wins,
including the odd-but-valid mode: remote + storage.backend: sqlite combo (an in-memory test runner pointed at the remote
API surface).
Trait Implementations§
Source§impl Clone for GatewayConfig
impl Clone for GatewayConfig
Source§fn clone(&self) -> GatewayConfig
fn clone(&self) -> GatewayConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GatewayConfig
impl Debug for GatewayConfig
Source§impl Default for GatewayConfig
impl Default for GatewayConfig
Source§fn default() -> GatewayConfig
fn default() -> GatewayConfig
impl Eq for GatewayConfig
Source§impl PartialEq for GatewayConfig
impl PartialEq for GatewayConfig
Source§fn eq(&self, other: &GatewayConfig) -> bool
fn eq(&self, other: &GatewayConfig) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for GatewayConfig
Auto Trait Implementations§
impl Freeze for GatewayConfig
impl RefUnwindSafe for GatewayConfig
impl Send for GatewayConfig
impl Sync for GatewayConfig
impl Unpin for GatewayConfig
impl UnsafeUnpin for GatewayConfig
impl UnwindSafe for GatewayConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.