euv_cli/update_server/
const.rs1pub const UPDATE_ROUTE_MANIFEST: &str = "/v1/projects/{project}/channels/{channel}/manifest";
3
4pub const UPDATE_ROUTE_BLOB: &str = "/v1/blobs/{sha256}";
6
7pub const UPDATE_ROUTE_EVENTS: &str = "/v1/projects/{project}/channels/{channel}/events";
9
10pub const DEFAULT_UPDATE_SERVER_HOST: &str = "127.0.0.1";
12
13pub const DEFAULT_UPDATE_SERVER_PORT: u16 = 8787;
15
16pub const DEFAULT_UPDATE_HEARTBEAT_MS: u64 = 15_000;
18
19pub const DEFAULT_UPDATE_WATCH_POLL_MS: u64 = 100;
21
22pub const DEFAULT_UPDATE_EVENT_LOG_CAP: usize = 256;
24
25pub const STORE_DIR_STAGING: &str = "staging";
27
28pub const STORE_DIR_BLOBS: &str = "blobs";
30
31pub const STORE_DIR_SHA256: &str = "sha256";
33
34pub const STORE_DIR_RELEASES: &str = "releases";
36
37pub const STORE_DIR_CHANNELS: &str = "channels";
39
40pub const STORE_DIR_TRACKS: &str = "tracks";
42
43pub const STORE_DIR_STATE: &str = "state";
45
46pub const STORE_DIR_EVENTS: &str = "events";
48
49pub(crate) const STORE_WRITER_LOCK_FILE: &str = "writer.lock";
51
52pub(crate) const STORE_ACTIVE_POINTER_FILE: &str = "active.json";
54
55pub(crate) const STORE_STAGED_MANIFEST_FILE: &str = "manifest.json";
57
58#[cfg(feature = "update-server")]
60pub(crate) const QUERY_KEY_PROTOCOL: &str = "protocol";
61
62#[cfg(feature = "update-server")]
64pub(crate) const QUERY_KEY_ABI: &str = "abi";
65
66#[cfg(feature = "update-server")]
68pub(crate) const QUERY_KEY_MODE: &str = "mode";
69
70#[cfg(feature = "update-server")]
72pub(crate) const QUERY_KEY_TRACK: &str = "track";
73
74#[cfg(feature = "update-server")]
76pub(crate) const QUERY_KEY_LAST_EVENT_ID: &str = "last_event_id";
77
78#[cfg(feature = "update-server")]
80pub(crate) const ROUTE_PARAM_PROJECT: &str = "project";
81
82#[cfg(feature = "update-server")]
84pub(crate) const ROUTE_PARAM_CHANNEL: &str = "channel";
85
86#[cfg(feature = "update-server")]
88pub(crate) const ROUTE_PARAM_SHA256: &str = "sha256";
89
90#[cfg(feature = "update-server")]
92pub(crate) const MODE_TOKEN_DATA: &str = "declarative_data";
93
94#[cfg(feature = "update-server")]
96pub(crate) const UPDATE_HDR_ETAG: &str = "etag";
97
98#[cfg(feature = "update-server")]
100pub(crate) const UPDATE_HDR_ACCEPT_RANGES: &str = "accept-ranges";
101
102#[cfg(feature = "update-server")]
104pub(crate) const UPDATE_HDR_BYTES: &str = "bytes";
105
106#[cfg(feature = "update-server")]
108pub(crate) const UPDATE_HDR_CONTENT_RANGE: &str = "content-range";
109
110#[cfg(feature = "update-server")]
112pub(crate) const UPDATE_HDR_RANGE_LOWER: &str = "range";
113
114#[cfg(feature = "update-server")]
116pub(crate) const UPDATE_HDR_LAST_EVENT_ID_LOWER: &str = "last-event-id";
117
118#[cfg(feature = "update-server")]
120pub(crate) const UPDATE_CACHE_IMMUTABLE: &str = "public, max-age=31536000, immutable";
121
122#[cfg(feature = "update-server")]
124pub(crate) const UPDATE_CACHE_NO_CACHE: &str = "no-cache";
125
126#[cfg(feature = "update-server")]
128pub(crate) const UPDATE_MIME_JSON: &str = "application/json; charset=utf-8";
129
130#[cfg(feature = "update-server")]
132pub(crate) const UPDATE_MIME_OCTET: &str = "application/octet-stream";
133
134pub(crate) const RANGE_BYTES_PREFIX: &str = "bytes=";
136
137pub(crate) const EXT_JSON_DOT: &str = ".json";
139
140pub(crate) const EXT_JSONL_DOT: &str = ".jsonl";
142
143pub(crate) const ASCII_HYPHEN: u8 = b'-';
145
146pub(crate) const ASCII_UNDERSCORE: u8 = b'_';
148
149pub(crate) const ASCII_DOT: u8 = b'.';
151
152pub(crate) const ERR_INVALID_STORE_IDENT: &str =
154 "store identifier must contain only ASCII alphanumerics, '-', '_', or '.' without traversal";
155
156pub(crate) const ERR_WRITER_LOCK_TIMEOUT: &str = "timed out acquiring update store writer lock";
158
159pub(crate) const ERR_EMPTY_SIGNING_KEY: &str =
161 "signing key cannot be empty for publish or rollback";
162
163pub(crate) const ERR_STAGE_NOT_FOUND: &str = "staged release directory not found";
165
166pub(crate) const ERR_ROLLBACK_TARGET_MISSING: &str = "rollback target release manifest not found";
168
169pub(crate) const ERR_BLOB_INTEGRITY: &str = "blob missing or SHA-256 digest mismatch";
171
172pub(crate) const ERR_NO_COMPATIBLE_RELEASE: &str =
174 "no compatible release available for client protocol, ABI, or delivery mode";
175
176#[cfg(not(feature = "update-server"))]
178pub(crate) const ERR_UPDATE_SERVER_FEATURE_DISABLED: &str =
179 "euv-cli was built without the `update-server` Cargo feature";
180
181#[cfg(feature = "update-server")]
183pub(crate) const ERR_BODY_NOT_FOUND: &str = "{\"error\":\"not_found\"}";
184
185#[cfg(feature = "update-server")]
187pub(crate) const ERR_BODY_METHOD_NOT_ALLOWED: &str = "{\"error\":\"method_not_allowed\"}";
188
189#[cfg(feature = "update-server")]
191pub(crate) const ERR_BODY_BAD_REQUEST: &str = "{\"error\":\"bad_request\"}";
192
193#[cfg(feature = "update-server")]
195pub(crate) const ERR_BODY_RANGE_INVALID: &str = "{\"error\":\"range_not_satisfiable\"}";
196
197#[cfg(feature = "update-server")]
199pub(crate) const ERR_BODY_UNCONFIGURED: &str = "{\"error\":\"update_server_unconfigured\"}";
200
201#[cfg(feature = "update-server")]
203pub(crate) const UPDATE_SSE_CONNECTED_COMMENT: &str = "connected";
204
205#[cfg(feature = "update-server")]
207pub(crate) const UPDATE_SSE_HEARTBEAT_COMMENT: &str = "keep-alive";