Module profiles

Module profiles 

Source
Expand description

Environment profiles (DW-110): dev/staging/prod config overlays.

A ProfileOverlay carries a base config plus per-profile config patches (each patch is a partial Gateway serialized as YAML). apply_profile merges the selected profile’s patch onto the base config: the patch’s collections (listeners, routes, upstreams, etc.) REPLACE the base’s (not append – a profile is a full topology overlay, not a delta), and the patch’s scalar fields override the base’s when set.

The profile is selected via the DWARA_PROFILE env var (one of dev, staging, prod; case-insensitive). When unset, no overlay is applied (the base config is used as-is).

The config schema type (ProfileOverlay) lives in crate::config (always present, so configs round-trip without the api_lifecycle feature). This module re-exports it as the runtime-facing alias the overlay applier consumes.

Re-exports§

pub use crate::config::LifecycleProfilesConfig as ProfileOverlay;

Structs§

AppliedProfile
The result of applying a profile overlay: the merged config as a YAML string, plus the profile that was selected (or None when no profile was selected).

Enums§

EnvProfile
The environment profile enum (dev/staging/prod).

Functions§

apply_profile
Apply the selected profile’s patch onto the base config.