kafka_remapper_core/lib.rs
1//! Kafka Partition Remapper Core Library
2//!
3//! This library provides the core functionality for a Kafka partition remapping proxy.
4//! It enables exposing a large number of virtual partitions to clients while using
5//! fewer physical partitions on the actual Kafka cluster, reducing per-partition costs.
6//!
7//! # Architecture
8//!
9//! The library is organized into several modules:
10//!
11//! - [`config`] - Configuration loading and validation
12//! - [`error`] - Domain-specific error types
13//! - [`remapper`] - Core partition/offset mapping logic
14//! - [`network`] - TCP listener and Kafka frame codec
15//! - [`broker`] - Backend Kafka broker connection pool
16//! - [`handlers`] - Kafka protocol request handlers
17//! - [`metrics`] - Prometheus metrics collection
18//! - [`tls`] - TLS/SSL support for secure connections
19//!
20//! # Example
21//!
22//! ```rust,ignore
23//! use kafka_remapper_core::config::ProxyConfig;
24//!
25//! // Load configuration
26//! let config = ProxyConfig::from_file("config.yaml")?;
27//!
28//! // Start the proxy
29//! // ...
30//! ```
31
32#![forbid(unsafe_code)]
33#![allow(dead_code, unused_variables, unused_imports, clippy::redundant_closure)]
34
35pub mod auth;
36pub mod broker;
37pub mod config;
38pub mod error;
39pub mod handlers;
40pub mod metrics;
41pub mod network;
42pub mod remapper;
43pub mod tls;
44
45/// Test utilities for integration testing.
46///
47/// This module is only available when compiling tests or when the `testing` feature is enabled.
48#[cfg(any(test, feature = "testing"))]
49pub mod testing;
50
51// Re-export commonly used types
52pub use auth::{SaslAuthenticator, SaslServer, SaslSession, SaslStepResult};
53pub use broker::{BrokerConnection, BrokerPool, BrokerStream};
54pub use config::{BrokerSaslConfig, BrokerTlsConfig, ProxyConfig, SaslMechanism, SecurityProtocol};
55pub use error::{AuthError, ConfigError, ProxyError, RemapError, Result, TlsError};
56pub use tls::{TlsConnector, TlsServerAcceptor};