Skip to main content

Crate hyperlane_plugin_etag

Crate hyperlane_plugin_etag 

Source
Expand description

hyperlane-plugin-etag

Opt-in automatic ETag and HTTP conditional request middleware for Hyperlane supporting strong and weak XxHash3_64 tags, zero-allocation If-None-Match (304 Not Modified), and If-Match (412 Precondition Failed) optimistic concurrency checks.

Structs§

EtagConfig
Configuration for EtagPlugin.
EtagPlugin
Precompiled ETag engine backing EtagRequestHook and EtagResponseHook.
EtagRequestHook
Opt-in request middleware enforcing If-Match preconditions (412 Precondition Failed).
EtagResponseHook
Opt-in response middleware generating ETag headers and converting matching If-None-Match to 304.

Enums§

EtagStrength
Strength of automatically generated entity tags.

Constants§

DEFAULT_MIN_ETAG_BYTES
Default minimum response body length eligible for automatic ETag generation (0 = all 2xx bodies).
DEFAULT_PRECONDITION_BODY
Default JSON body emitted when If-Match fails (412 Precondition Failed).
DEFAULT_PRECONDITION_CONTENT_TYPE
Default Content-Type emitted for 412 Precondition Failed rejections.

Traits§

EtagValidator
Pluggable current-version ETag lookup used to enforce If-Match optimistic locking on mutating requests.

Functions§

compute_etag
Computes a formatted strong or weak ETag string for body.
hash_entity_bytes
Computes a 64-bit XxHash3_64 digest of body.
matches_if_match_strong
Evaluates an RFC 9110 §13.1.1 If-Match header against current_etag using strong comparison.