pub struct UpstreamConfig {Show 13 fields
pub name: String,
pub backends: Vec<String>,
pub strategy: String,
pub health_check: Option<HealthCheckConfig>,
pub tls: bool,
pub tls_ca_file: Option<String>,
pub tls_client_cert_file: Option<String>,
pub tls_client_key_file: Option<String>,
pub weights: Vec<u32>,
pub sticky: Option<StickyConfig>,
pub circuit_breaker: Option<BreakerConfig>,
pub retry: Option<RetryConfig>,
pub protocol: String,
}Fields§
§name: String§backends: Vec<String>§strategy: String§health_check: Option<HealthCheckConfig>§tls: booltrue when all backends use https:// scheme — connections to the
upstream are made over TLS. Requires the http-client or http2
feature (which bring in rustls + webpki-roots).
tls_ca_file: Option<String>tls_ca_file — PEM file of CA certificates to trust for this
upstream’s https:// backends instead of the public WebPKI roots
(a private CA or a self-signed certificate). None = WebPKI.
tls_client_cert_file: Option<String>tls_client_cert_file / tls_client_key_file — a client certificate
(PEM chain and key) presented to TLS backends that require one.
Since 18.3.0.
tls_client_key_file: Option<String>§weights: Vec<u32>weights — one per backend, in order (default 1 each). Since 18.6.0.
sticky: Option<StickyConfig>[upstream.sticky] — keep a client on one backend. Since 18.6.0.
circuit_breaker: Option<BreakerConfig>[upstream.circuit_breaker] — take failing backends out of rotation
(passive health checks). Since 18.6.0.
retry: Option<RetryConfig>[upstream.retry] — try another backend. Since 18.6.0.
protocol: Stringprotocol — "h3" sends requests over HTTP/3 (QUIC) to the
https:// backends, falling back to TCP for a backend QUIC can’t
reach. Empty (the default) or "http1": HTTP/1.1 as before. Since
18.13.0.
Trait Implementations§
Source§impl Clone for UpstreamConfig
impl Clone for UpstreamConfig
Source§fn clone(&self) -> UpstreamConfig
fn clone(&self) -> UpstreamConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for UpstreamConfig
impl RefUnwindSafe for UpstreamConfig
impl Send for UpstreamConfig
impl Sync for UpstreamConfig
impl Unpin for UpstreamConfig
impl UnsafeUnpin for UpstreamConfig
impl UnwindSafe for UpstreamConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
map-response-body only.Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
trace only.Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
trace only.