pub struct PassthroughPolicy {
pub cluster: ClusterId,
pub endpoint: Option<String>,
/* private fields */
}Expand description
Where a passthrough proxy forwards a matching request: one cluster and its base URL, plus the logical-index prefixes that select which requests pass through verbatim (empty ⇒ all of them).
Fields§
§cluster: ClusterIdThe cluster a matching request is forwarded to.
endpoint: Option<String>The cluster’s base URL (the sink pools it like any endpoint).
Implementations§
Source§impl PassthroughPolicy
impl PassthroughPolicy
Sourcepub fn new(cluster: ClusterId, endpoint: impl Into<String>) -> Self
pub fn new(cluster: ClusterId, endpoint: impl Into<String>) -> Self
A policy forwarding every request to cluster at endpoint (the
whole-instance transparent proxy). Add with_index_prefixes to pass
through only selected indices and tenant-isolate the rest.
Sourcepub fn with_index_prefixes(self, prefixes: Vec<String>) -> Self
pub fn with_index_prefixes(self, prefixes: Vec<String>) -> Self
Restricts passthrough to requests whose logical index starts with one of
prefixes; all other requests keep full tenancy. An empty list (the
default) passes everything through.
Sourcepub fn matches(&self, ctx: &RequestCtx<'_>) -> bool
pub fn matches(&self, ctx: &RequestCtx<'_>) -> bool
Whether ctx should be forwarded verbatim. Matches when no prefixes are
configured (whole-instance passthrough) or the request’s logical index
starts with a configured prefix; otherwise the request stays tenanted.
Sourcepub fn matches_index(&self, logical_index: &str) -> bool
pub fn matches_index(&self, logical_index: &str) -> bool
Whether a request for logical_index should be forwarded verbatim. The
body-free half of matches, so the transport can decide
to stream a passthrough request before buffering its body (ADR-014
stage 2).
Trait Implementations§
Source§impl Clone for PassthroughPolicy
impl Clone for PassthroughPolicy
Source§fn clone(&self) -> PassthroughPolicy
fn clone(&self) -> PassthroughPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more