Skip to main content

hyperlane_plugin_cache/
lib.rs

1//! hyperlane-plugin-cache
2//!
3//! 64-way sharded bounded cache and HTTP response caching plugin for Hyperlane
4//! with TTL/byte-budget eviction, single-flight stampede coalescing, pluggable
5//! [`CacheStore`] traits, and RFC `Cache-Control`/`Age`/`X-Cache` support.
6
7mod r#const;
8mod r#fn;
9mod r#impl;
10mod r#static;
11mod r#struct;
12mod r#trait;
13mod r#type;
14
15#[cfg(test)]
16#[path = "../tests/mod.rs"]
17mod tests;
18
19pub use {r#const::*, r#struct::*, r#trait::*, r#type::*};
20
21pub(crate) use {r#fn::*, r#static::*};
22
23use std::{
24    array::from_fn,
25    collections::VecDeque,
26    future::Future,
27    hash::Hasher,
28    pin::Pin,
29    sync::{
30        Arc, Mutex, OnceLock, RwLock, RwLockReadGuard, RwLockWriteGuard,
31        atomic::{AtomicUsize, Ordering},
32    },
33    time::{Duration, SystemTime, UNIX_EPOCH},
34};
35
36use {
37    hyperlane::{
38        AGE, AUTHORIZATION, CACHE_CONTROL, COOKIE, Context, HashMapXxHash3_64, HttpStatus,
39        RequestQuerys, Response, ResponseData, ResponseError, ServerHook, Status, Stream, VARY,
40        XxHash3_64, hash_map_xx_hash3_64,
41        tokio::sync::{Notify, futures::Notified},
42    },
43    lombok_macros::*,
44};