Expand description
Sentinel Proxy Library
A security-first reverse proxy built on Pingora with sleepable ops at the edge.
This library provides the core components for building a production-grade reverse proxy with:
- Routing: Flexible path-based and header-based routing
- Upstream Management: Load balancing, health checking, circuit breakers
- Static File Serving: Compression, caching, range requests
- Validation: JSON Schema validation for API requests/responses
- Error Handling: Customizable error pages per service type
- Hot Reload: Configuration changes without restarts
§Example
ⓘ
use sentinel_proxy::{StaticFileServer, ErrorHandler, SchemaValidator};
use sentinel_config::{StaticFileConfig, ServiceType};
// Create a static file server
let config = StaticFileConfig::default();
let server = StaticFileServer::new(config);
// Create an error handler for API responses
let handler = ErrorHandler::new(ServiceType::Api, None);Re-exports§
pub use errors::ErrorHandler;pub use static_files::CacheStats;pub use static_files::CachedFile;pub use static_files::FileCache;pub use static_files::StaticFileServer;pub use validation::SchemaValidator;pub use routing::RouteMatcher;pub use routing::RouteMatch;pub use routing::RequestInfo;pub use upstream::LoadBalancer;pub use upstream::PoolStats;pub use upstream::RequestContext;pub use upstream::TargetSelection;pub use upstream::UpstreamPool;pub use upstream::UpstreamTarget;pub use health::ActiveHealthChecker;pub use health::PassiveHealthChecker;pub use health::TargetHealthInfo;pub use agents::AgentAction;pub use agents::AgentCallContext;pub use agents::AgentDecision;pub use agents::AgentManager;pub use reload::ConfigManager;pub use reload::ReloadEvent;pub use reload::ReloadTrigger;pub use reload::SignalManager;pub use reload::SignalType;pub use app::AppState;pub use proxy::SentinelProxy;pub use builtin_handlers::execute_handler;pub use builtin_handlers::BuiltinHandlerState;pub use builtin_handlers::TargetHealthStatus;pub use builtin_handlers::TargetStatus;pub use builtin_handlers::UpstreamHealthSnapshot;pub use builtin_handlers::UpstreamStatus;pub use http_helpers::extract_request_info;pub use http_helpers::get_or_create_trace_id;pub use http_helpers::write_error;pub use http_helpers::write_json_error;pub use http_helpers::write_response;pub use http_helpers::write_text_error;pub use trace_id::generate_for_format;pub use trace_id::generate_tinyflake;pub use trace_id::generate_uuid;pub use trace_id::TINYFLAKE_LENGTH;pub use logging::AccessLogEntry;pub use logging::AccessLogFormat;pub use logging::AuditLogEntry;pub use logging::ErrorLogEntry;pub use logging::LogManager;
Modules§
- agents
- Agent integration module for Sentinel proxy.
- app
- Application module for Sentinel proxy
- builtin_
handlers - Built-in handlers for Sentinel proxy
- errors
- Error handling module for Sentinel proxy
- health
- Health checking module for Sentinel proxy
- http_
helpers - HTTP request and response helpers for Sentinel proxy
- logging
- Logging infrastructure for Sentinel proxy
- proxy
- Sentinel Proxy Core Implementation
- reload
- Configuration hot reload module for Sentinel proxy.
- routing
- Route matching and selection module for Sentinel proxy
- static_
files - Static file serving module for Sentinel proxy
- trace_
id - TinyFlake: Operator-friendly Trace ID Generation
- upstream
- Upstream pool management module for Sentinel proxy
- validation
- API schema validation module for Sentinel proxy
Enums§
- Limit
Type - Types of limits that can be exceeded
- Sentinel
Error - Main error type for Sentinel operations
- Trace
IdFormat - Trace ID format selection.
Type Aliases§
- Sentinel
Result - Result type alias for Sentinel operations