pub struct RouteStore { /* private fields */ }Expand description
Store of all configured routes, keyed by normalised prefix.
Loaded at proxy startup for all routes in the config, not just those with credentials. This ensures L7 endpoint filtering and upstream routing work independently of credential presence.
Implementations§
Source§impl RouteStore
impl RouteStore
Sourcepub fn load(routes: &[RouteConfig]) -> Result<Self>
pub fn load(routes: &[RouteConfig]) -> Result<Self>
Load route configuration for all configured routes.
Each route’s endpoint rules are compiled at startup so the hot path
does a regex match, not a glob compile. Routes with a tls_ca field
get a per-route TLS connector built from the custom CA certificate.
Sourcepub fn get(&self, prefix: &str) -> Option<&LoadedRoute>
pub fn get(&self, prefix: &str) -> Option<&LoadedRoute>
Get a loaded route by normalised prefix, if configured.
Sourcepub fn is_route_upstream(&self, host_port: &str) -> bool
pub fn is_route_upstream(&self, host_port: &str) -> bool
Check whether host_port (e.g. "api.openai.com:443") matches
any route’s upstream URL. Uses pre-normalised host:port strings
computed at load time to avoid per-request URL parsing.
Sourcepub fn route_upstream_hosts(&self) -> HashSet<String>
pub fn route_upstream_hosts(&self) -> HashSet<String>
Return the set of normalised host:port strings for all route
upstreams. Uses pre-normalised values computed at load time.