| Crates.io | cardinal-rs |
| lib.rs | cardinal-rs |
| version | 0.2.41 |
| created_at | 2025-09-26 03:43:35.92579+00 |
| updated_at | 2025-11-28 16:47:31.704765+00 |
| description | Runtime orchestrator for the Cardinal reverse proxy |
| homepage | https://github.com/andrespirela/cardinal |
| repository | https://github.com/andrespirela/cardinal |
| max_upload_size | |
| id | 1855394 |
| size | 220,580 |
This crate assembles the gateway: feeding configuration into CardinalContext, registering default providers, and booting the Pingora service.
CardinalBuilder wires a CardinalContext, handles provider registration, and exposes extension hooks.Cardinal wraps the built context and knows how to run the proxy.with_context_provider lets callers inject a custom CardinalContextProvider (e.g. host-based lookup) while the default remains a static provider.let config = cardinal_config::load_config(&["config/local.toml".into()])?;
let gateway = Cardinal::builder(config)
.register_provider::<Telemetry>(ProviderScope::Singleton)
.with_context_provider(my_provider) // optional
.build();
gateway.run()?;
CardinalBuilder::new_empty is available if you want to bypass default registrations and compose the provider graph manually (useful for tests).