pub struct HealthCheckConfig {
pub uri: String,
pub interval: u32,
pub timeout: u32,
pub healthy_threshold: u32,
pub unhealthy_threshold: u32,
pub expected_status: u32,
pub mode: i32,
pub accepted_statuses: Vec<HttpStatusRange>,
pub port: Option<u32>,
pub headers: Vec<HealthCheckHeader>,
}Fields§
§uri: StringRequest target of the HTTP probe; must start with /. Ignored in
TCP mode. Kept required on the wire for compatibility with
peers that predate mode.
interval: u32§timeout: u32§healthy_threshold: u32§unhealthy_threshold: u32§expected_status: u320 accepts any 2xx, any other value exactly that status. Applies
only while accepted_statuses is empty; setting both is rejected.
mode: i32Probe mode. Absent decodes as HTTP, the behaviour of peers that
predate this field.
accepted_statuses: Vec<HttpStatusRange>HTTP mode: the response statuses that count as healthy. When
non-empty it replaces expected_status, which must then be 0.
port: Option<u32>Port the probe dials, in 1..=65535; unset = the backend’s data
port. When set, both HTTP and TCP probes connect to the backend’s IP
address with this port, and the HTTP probe’s Host names that
address. A peer that predates this field ignores it and probes the
data port.
headers: Vec<HealthCheckHeader>Extra request header fields of the HTTP probe (typically
Authorization), in the order they are sent. Refused in TCP mode, with
more than 32 entries, with a duplicate name (compared case-insensitively),
with a name that is not an RFC 9110 token or that begins with : or is
one of host, connection, keep-alive, proxy-connection,
transfer-encoding, content-length, te, trailer, upgrade,
expect, with a value holding a control byte other than HTAB or beginning or ending
with SP or HTAB (RFC 9113 section 8.2.1; protobuf
and TOML keep exact bytes and are refused), or when
the sum of name + value + 4 bytes exceeds 8192 or the HTTP/2 probe’s
HPACK block (four pseudo-headers included) may exceed 16384 bytes.
Only names and fingerprints live here; the values travel in
SetProtectedHealthCheck. A configuration that names headers whose
values the process does not hold (restored from a saved state, or set
through SetHealthCheck) sends no probe until they are provided again.
A peer that predates this field ignores it, probes without the headers,
and drops them when it re-emits the state.
The probe wire format is derived from Cluster.http2 (the same
backend-capability hint the mux router reads). When the cluster
sets http2 = true, the probe sends the HTTP/2 connection
preface + empty SETTINGS + HEADERS frame on stream 1; otherwise
HTTP/1.1. There is no per-HealthCheckConfig h2c flag — the
probe wire follows the data-plane wire so an h2c-only backend
is never probed with HTTP/1.1 (and vice versa).
Implementations§
Source§impl HealthCheckConfig
impl HealthCheckConfig
Sourcepub fn mode(&self) -> HealthCheckMode
pub fn mode(&self) -> HealthCheckMode
Returns the enum value of mode, or the default if the field is set to an invalid enum value.
Sourcepub fn set_mode(&mut self, value: HealthCheckMode)
pub fn set_mode(&mut self, value: HealthCheckMode)
Sets mode to the provided enum value.
Trait Implementations§
Source§impl Clone for HealthCheckConfig
impl Clone for HealthCheckConfig
Source§impl Debug for HealthCheckConfig
impl Debug for HealthCheckConfig
Source§impl Default for HealthCheckConfig
impl Default for HealthCheckConfig
Source§impl<'de> Deserialize<'de> for HealthCheckConfig
impl<'de> Deserialize<'de> for HealthCheckConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for HealthCheckConfig
Source§impl Hash for HealthCheckConfig
impl Hash for HealthCheckConfig
Source§impl Message for HealthCheckConfig
impl Message for HealthCheckConfig
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl Ord for HealthCheckConfig
impl Ord for HealthCheckConfig
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for HealthCheckConfig
impl PartialEq for HealthCheckConfig
Source§impl PartialOrd for HealthCheckConfig
impl PartialOrd for HealthCheckConfig
Source§impl Serialize for HealthCheckConfig
impl Serialize for HealthCheckConfig
impl StructuralPartialEq for HealthCheckConfig
Auto Trait Implementations§
impl Freeze for HealthCheckConfig
impl RefUnwindSafe for HealthCheckConfig
impl Send for HealthCheckConfig
impl Sync for HealthCheckConfig
impl Unpin for HealthCheckConfig
impl UnsafeUnpin for HealthCheckConfig
impl UnwindSafe for HealthCheckConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.