Skip to main content

kanade_shared/
kv.rs

1//! NATS KV bucket name + key helpers (spec §2.3.2).
2//!
3//! NATS KV bucket names must be domain-safe ASCII (a-z, A-Z, 0-9, _, -),
4//! so the spec's dotted names (`script.current`, `script.status`) are
5//! flattened to underscore form here.
6
7pub const BUCKET_SCRIPT_CURRENT: &str = "script_current";
8pub const BUCKET_SCRIPT_STATUS: &str = "script_status";
9pub const BUCKET_AGENTS_STATE: &str = "agents_state";
10pub const BUCKET_AGENT_CONFIG: &str = "agent_config";
11pub const BUCKET_SCHEDULES: &str = "schedules";
12
13/// Object Store bucket holding raw agent binaries (one object per
14/// version, e.g. `0.2.0` → file bytes).
15pub const OBJECT_AGENT_RELEASES: &str = "agent_releases";
16
17/// Key inside [`BUCKET_AGENT_CONFIG`] carrying the broadcast target
18/// version. Agents watch this key and self-update when their running
19/// version drifts.
20pub const KEY_AGENT_TARGET_VERSION: &str = "target_version";
21
22pub const SCRIPT_STATUS_ACTIVE: &str = "ACTIVE";
23pub const SCRIPT_STATUS_REVOKED: &str = "REVOKED";
24
25pub const STREAM_INVENTORY: &str = "INVENTORY";
26pub const STREAM_RESULTS: &str = "RESULTS";
27pub const STREAM_DEPLOY: &str = "DEPLOY";
28pub const STREAM_EVENTS: &str = "EVENTS";
29pub const STREAM_AUDIT: &str = "AUDIT";