pub struct DaemonConfig {
pub bind_address: SocketAddr,
pub data_dir: PathBuf,
pub enable_control: bool,
pub metrics_bind: Option<SocketAddr>,
}Expand description
Daemon configuration for the ActionQueue service.
This struct defines the operator-facing configuration contract for the ActionQueue daemon. It is designed to be explicit, deterministic, and serializable.
§Default posture
The default configuration:
- Binds the HTTP API to
127.0.0.1:8787 - Uses the literal string
~/.actionqueue/dataas the data directory (no expansion) - Has control endpoints disabled by default
- Has metrics enabled on a separate port
§Invariants
- Configuration must not permit state mutation paths (no “auto-apply” flags or bypass toggles).
- Config values must be explicit and inspectable to preserve auditability.
- No implicit environment reads inside constructors or default methods.
§Example
use actionqueue_daemon::config::DaemonConfig;
let config = DaemonConfig::default();
assert!(!config.enable_control);
assert_eq!(config.bind_address.ip(), std::net::IpAddr::V4(std::net::Ipv4Addr::LOCALHOST));Fields§
§bind_address: SocketAddrThe bind address (IP and port) for the daemon HTTP server.
This is the primary operational surface for read-only introspection endpoints. In v0.1, the daemon listens on localhost by default.
§Default
127.0.0.1:8787
data_dir: PathBufThe data directory or persistence root path.
This path is used for WAL files and optional snapshots. The daemon
expects to have read/write permissions on this directory.
The daemon expects <data_dir>/wal/ and <data_dir>/snapshots/ to exist or be creatable; filenames are fixed to actionqueue.wal and snapshot.bin.
§Default
The literal string ~/.actionqueue/data. No expansion of ~ or environment
variables occurs in DaemonConfig::default. The caller/operator is
responsible for resolving the path to a concrete filesystem location if
required.
enable_control: boolFeature flag to enable control endpoints.
When false (the default), control endpoints are unreachable. When
true, control endpoints (/api/v1/tasks/:task_id/cancel,
/api/v1/runs/:run_id/cancel, /api/v1/engine/pause,
/api/v1/engine/resume) are registered and may be invoked.
§Safety
Control endpoints require explicit enablement to enforce least-privilege by default. This prevents accidental activation of mutating operations.
§Default
false
metrics_bind: Option<SocketAddr>The bind address for Prometheus-compatible metrics.
If None, metrics are disabled. If Some, metrics are exposed on the
specified socket address.
§Default
Some(SocketAddr::new(IpAddr::V4(Ipv4Addr::LOCALHOST), 9090))
Implementations§
Source§impl DaemonConfig
impl DaemonConfig
Trait Implementations§
Source§impl Clone for DaemonConfig
impl Clone for DaemonConfig
Source§fn clone(&self) -> DaemonConfig
fn clone(&self) -> DaemonConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more