pub struct HttpConfig {Show 14 fields
pub check_frequency: i64,
pub confirmation_period: i64,
pub recovery_period: i64,
pub timeout: i32,
pub method: String,
pub protocol: String,
pub port: Option<u16>,
pub path: Option<String>,
pub body: Option<String>,
pub keyword: Option<String>,
pub expected_status_code: i32,
pub follow_redirects: bool,
pub keep_cookies_on_redirects: bool,
pub headers: Option<Vec<Header>>,
}Expand description
Configuration for an HTTP monitor.
Fields§
§check_frequency: i64How often the monitor should perform a check, in seconds.
confirmation_period: i64Number of consecutive successful checks required to confirm a state change.
recovery_period: i64Number of consecutive failed checks required to consider the monitor recovered.
timeout: i32Maximum time, in seconds, to wait for an HTTP response before timing out.
method: StringHTTP method to use (e.g., GET, POST).
protocol: StringProtocol to use (HTTP or HTTPS).
port: Option<u16>Optional port number. If None, defaults to 80 for HTTP and 443 for HTTPS.
path: Option<String>Optional request path (e.g., “/health”).
body: Option<String>Optional request body for methods like POST or PUT.
keyword: Option<String>Optional keyword to search for in the response body.
expected_status_code: i32Expected HTTP status code.
follow_redirects: boolWhether to follow HTTP redirects.
Whether to keep cookies when following redirects.
headers: Option<Vec<Header>>Optional HTTP headers to include in the request.
Trait Implementations§
Source§impl Debug for HttpConfig
impl Debug for HttpConfig
Source§impl Default for HttpConfig
impl Default for HttpConfig
Source§fn default() -> HttpConfig
fn default() -> HttpConfig
Source§impl<'de> Deserialize<'de> for HttpConfig
impl<'de> Deserialize<'de> for HttpConfig
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>,
Auto Trait Implementations§
impl Freeze for HttpConfig
impl RefUnwindSafe for HttpConfig
impl Send for HttpConfig
impl Sync for HttpConfig
impl Unpin for HttpConfig
impl UnsafeUnpin for HttpConfig
impl UnwindSafe for HttpConfig
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
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 more