pub struct SgBackendRef<P = PluginInstanceId> {
pub host: BackendHost,
pub port: Option<u16>,
pub timeout_ms: Option<u32>,
pub protocol: Option<SgBackendProtocol>,
pub downgrade_http2: Option<bool>,
pub weight: Option<u16>,
pub plugins: Vec<P>,
}Expand description
BackendRef defines how a HTTPRoute should forward an HTTP request.
Fields§
§host: BackendHost§port: Option<u16>Port specifies the destination port number to use for this resource.
timeout_ms: Option<u32>Timeout specifies the timeout for requests forwarded to the referenced backend.
protocol: Option<SgBackendProtocol>§downgrade_http2: Option<bool>Downgrade HTTP2 connections, it is useful when the backend does not support HTTP2.
weight: Option<u16>Weight specifies the proportion of requests forwarded to the referenced backend. This is computed as weight/(sum of all weights in this BackendRefs list). For non-zero values, there may be some epsilon from the exact proportion defined here depending on the precision an implementation supports. Weight is not a percentage and the sum of weights does not need to equal 100.
plugins: Vec<P>plugins define the filters that are applied to backend that match this hostnames.
§Notice!
this field is ordered, the first plugin will be the outermost plugin.
Implementations§
Source§impl<P> SgBackendRef<P>
impl<P> SgBackendRef<P>
pub fn map_plugins<F, T>(self, f: F) -> SgBackendRef<T>where
F: FnMut(P) -> T,
pub fn get_host(&self) -> String
Trait Implementations§
Source§impl<P: Clone> Clone for SgBackendRef<P>
impl<P: Clone> Clone for SgBackendRef<P>
Source§fn clone(&self) -> SgBackendRef<P>
fn clone(&self) -> SgBackendRef<P>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more