Skip to main content

hyperlane_plugin_gateway/
lib.rs

1//! hyperlane-plugin-gateway
2//!
3//! High-concurrency reverse proxy and API gateway plugin for Hyperlane
4//! providing prefix/host routing, allocation-free load balancing
5//! (round-robin, weighted, least-connections, power-of-two-choices),
6//! circuit breaking, lock-free GCRA rate limiting, extensible interceptors,
7//! RFC 9110 hop-by-hop header stripping, and pooled HTTP/1.1 + HTTP/2 forwarding.
8
9mod r#const;
10mod r#enum;
11mod r#fn;
12mod r#impl;
13mod r#static;
14mod r#struct;
15mod r#trait;
16
17#[cfg(test)]
18#[path = "../tests/mod.rs"]
19mod tests;
20
21pub use {r#const::*, r#enum::*, r#fn::*, r#struct::*, r#trait::*};
22
23pub(crate) use r#static::*;
24
25use std::{
26    collections::{HashMap, HashSet, VecDeque},
27    net::SocketAddr,
28    sync::{
29        Arc, OnceLock,
30        atomic::{AtomicU32, AtomicU64, AtomicUsize, Ordering},
31    },
32    time::{Duration, Instant, SystemTime, UNIX_EPOCH},
33};
34
35use {
36    http_request::{HttpRequest, HttpResponse, RequestBuilder, RequestError},
37    hyperlane::{
38        CONNECTION, Context, HOST, HashMapXxHash3_64, HttpStatus, KEEP_ALIVE, PROXY_AUTHENTICATE,
39        PROXY_AUTHORIZATION, Request, Response, ResponseError, ServerHook, Status, Stream, TE,
40        TRANSFER_ENCODING, UPGRADE,
41    },
42    lombok_macros::*,
43};