hyperlane-plugin-etag 23.3.2

An opt-in automatic ETag and HTTP conditional request plugin for the Hyperlane framework providing strong/weak XxHash3_64 entity tags, zero-allocation If-None-Match 304 Not Modified, and If-Match 412 Precondition Failed optimistic concurrency.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/// Default minimum response body length eligible for automatic ETag generation (`0` = all 2xx bodies).
pub const DEFAULT_MIN_ETAG_BYTES: usize = 0;

/// Default `Content-Type` emitted for `412 Precondition Failed` rejections.
pub const DEFAULT_PRECONDITION_CONTENT_TYPE: &str = "application/json; charset=utf-8";

/// Default JSON body emitted when `If-Match` fails (`412 Precondition Failed`).
pub const DEFAULT_PRECONDITION_BODY: &[u8] =
    br#"{"error":"precondition_failed","message":"entity tag precondition failed"}"#;

/// Lowercase hexadecimal digits for stack-based ETag formatting.
pub(crate) const HEX_LOWER: &[u8; 16] = b"0123456789abcdef";

/// Weak ETag prefix (`W/`).
pub(crate) const WEAK_PREFIX: &str = "W/";

/// Root slash constant.
pub(crate) const ROOT_SLASH: &str = "/";