pub struct Config {
pub port: u16,
pub log_dir: PathBuf,
pub log_level: String,
pub retention_days: u32,
pub extra_patterns: Vec<String>,
pub foreground: bool,
pub update: UpdateConfig,
}Expand description
Resolved runtime configuration for the OpenLatch daemon.
This struct is constructed by Config::load from the full precedence chain:
CLI flags > env vars > config.toml > defaults.
Fields§
§port: u16TCP port for the local daemon (default: 7443).
log_dir: PathBufDirectory for audit and daemon logs.
log_level: StringTracing log level (default: “info”).
retention_days: u32Audit log retention in days (default: 30).
extra_patterns: Vec<String>Additional regex patterns for secret masking (additive to built-ins, per D-03).
foreground: boolWhen true, daemon runs in foreground without forking.
update: UpdateConfigUpdate check configuration (UPDT-01 through UPDT-04).
Implementations§
Source§impl Config
impl Config
Sourcepub fn load(
cli_port: Option<u16>,
cli_log_level: Option<String>,
cli_foreground: bool,
) -> Result<Self, OlError>
pub fn load( cli_port: Option<u16>, cli_log_level: Option<String>, cli_foreground: bool, ) -> Result<Self, OlError>
Load configuration from the full precedence chain.
Precedence order (highest to lowest):
- CLI flags (
cli_*parameters —Some(value)overrides) - Environment variables (
OPENLATCH_PORT,OPENLATCH_HOST,OPENLATCH_LOG_DIR,OPENLATCH_LOG,OPENLATCH_RETENTION_DAYS) ~/.openlatch/config.toml(parsed, partial overrides)- Compile-time defaults
§Errors
Returns OlError if the config file exists but cannot be parsed as valid TOML.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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
Mutably borrows from an owned value. Read more