Skip to main content

Monitor

Struct Monitor 

Source
pub struct Monitor {
Show 25 fields pub name: String, pub kind: Kind, pub url: Option<String>, pub host: Option<String>, pub port: Option<u16>, pub app: Option<String>, pub stack: Option<String>, pub service: Option<String>, pub domain: Option<String>, pub path: Option<String>, pub method: String, pub expected_status: String, pub keyword: Option<String>, pub keyword_absent: Option<String>, pub follow_redirects: bool, pub headers: Vec<Header>, pub interval: u64, pub timeout: u64, pub failure_threshold: u32, pub recovery_threshold: u32, pub cert_expiry_days: u32, pub paused: bool, pub auto: bool, pub created_at: u64, pub updated_at: u64,
}
Expand description

One monitor. Fields that do not apply to its type are refused.

Fields§

§name: String§kind: Kind§url: Option<String>

http: the URL.

§host: Option<String>

tcp: host and port.

§port: Option<u16>§app: Option<String>

app: the app, by name.

§stack: Option<String>

service: the compose stack, by name.

§service: Option<String>

service: the stack’s service, by name.

§domain: Option<String>

app, service: which of its domains (default: the first one served).

§path: Option<String>

app, service: the path to request (default: the path the service’s healthcheck requests over HTTP, else the domain’s path).

§method: String

GET or HEAD.

§expected_status: String

Status codes that count as up: 200-399, 200,204, 200-299,301.

§keyword: Option<String>

The body must contain this.

§keyword_absent: Option<String>

The body must not contain this.

§follow_redirects: bool§headers: Vec<Header>§interval: u64

Seconds between checks (at least 30).

§timeout: u64

Seconds one check may take.

§failure_threshold: u32

Failed checks in a row that make it down.

§recovery_threshold: u32

Successful checks in a row that make it up again.

§cert_expiry_days: u32

Warn this many days before an HTTPS certificate expires (0: never).

§paused: bool§auto: bool

Made for an app (app-<name>) or a compose stack service (stack-<stack>-<service>) with a served domain.

§created_at: u64§updated_at: u64

Implementations§

Source§

impl Monitor

Source

pub fn new(name: &str, kind: Kind) -> Monitor

A bare monitor of kind with every default.

Source

pub fn validate(&self) -> Result<()>

Check everything but whether an app or secret exists.

Source

pub fn follows(&self) -> bool

Does it follow something by reference (an app or a stack service)?

Source

pub fn secrets(&self) -> Vec<&str>

The secrets the monitor reads.

Source

pub fn target(&self) -> String

What it checks, in a few words.

Trait Implementations§

Source§

impl Clone for Monitor

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Monitor

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Monitor

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Monitor

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Monitor

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Monitor

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AnyEq for T
where T: Any + PartialEq,

Source§

fn equals(&self, other: &(dyn Any + 'static)) -> bool

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V