Skip to main content

pingora/
lib.rs

1// Copyright 2026 Cloudflare, Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#![warn(clippy::all)]
16#![allow(clippy::new_without_default)]
17#![allow(clippy::type_complexity)]
18#![allow(clippy::match_wild_err_arm)]
19#![allow(clippy::missing_safety_doc)]
20#![allow(clippy::upper_case_acronyms)]
21// This enables the feature that labels modules that are only available with
22// certain pingora features
23#![cfg_attr(docsrs, feature(doc_cfg))]
24
25//! # Pingora
26//!
27//! Pingora is a framework to build fast, reliable and programmable networked systems at Internet scale.
28//!
29//! # Features
30//! - Http 1.x and Http 2
31//! - Modern TLS with OpenSSL or BoringSSL (FIPS compatible)
32//! - Zero downtime upgrade
33//!
34//! # Usage
35//! This crate provides low level service and protocol implementation and abstraction.
36//!
37//! If looking to build a (reverse) proxy, see [`pingora-proxy`](https://docs.rs/pingora-proxy) crate.
38//!
39//! # Feature flags
40#![cfg_attr(
41    feature = "document-features",
42    cfg_attr(doc, doc = ::document_features::document_features!())
43)]
44
45pub use pingora_core::*;
46
47/// HTTP header objects that preserve http header cases
48pub mod http {
49    pub use pingora_http::*;
50}
51
52#[cfg(feature = "cache")]
53#[cfg_attr(docsrs, doc(cfg(feature = "cache")))]
54/// Caching services and tooling
55pub mod cache {
56    pub use pingora_cache::*;
57}
58
59#[cfg(feature = "lb")]
60#[cfg_attr(docsrs, doc(cfg(feature = "lb")))]
61/// Load balancing recipes
62pub mod lb {
63    pub use pingora_load_balancing::*;
64}
65
66#[cfg(feature = "proxy")]
67#[cfg_attr(docsrs, doc(cfg(feature = "proxy")))]
68/// Proxying recipes
69pub mod proxy {
70    pub use pingora_proxy::*;
71}
72
73#[cfg(feature = "time")]
74#[cfg_attr(docsrs, doc(cfg(feature = "time")))]
75/// Timeouts and other useful time utilities
76pub mod time {
77    pub use pingora_timeout::*;
78}
79
80/// A useful set of types for getting started
81pub mod prelude {
82    pub use pingora_core::prelude::*;
83    pub use pingora_http::prelude::*;
84    pub use pingora_timeout::*;
85
86    #[cfg(feature = "cache")]
87    #[cfg_attr(docsrs, doc(cfg(feature = "cache")))]
88    pub use pingora_cache::prelude::*;
89
90    #[cfg(feature = "lb")]
91    #[cfg_attr(docsrs, doc(cfg(feature = "lb")))]
92    pub use pingora_load_balancing::prelude::*;
93
94    #[cfg(feature = "proxy")]
95    #[cfg_attr(docsrs, doc(cfg(feature = "proxy")))]
96    pub use pingora_proxy::prelude::*;
97
98    #[cfg(feature = "time")]
99    #[cfg_attr(docsrs, doc(cfg(feature = "time")))]
100    pub use pingora_timeout::*;
101}