pub struct WebhookNotifyConfig {
pub url: String,
pub method: String,
pub headers: BTreeMap<String, String>,
pub body: String,
pub events: Vec<String>,
pub timeout_ms: u64,
}Expand description
Configuration for one named webhook notify target: an HTTP request whose
URL, method, headers and body are all the operator’s to state.
This is what makes a chat provider configuration rather than a backend —
Slack, Mattermost, Teams, Telegram and Matrix differ only in these four
values. See crate::notify::webhook.
Fields§
§url: StringThe endpoint to call. Required once the entry is selected; it routinely carries the credential in its path (a Slack hook id, a Telegram bot token), which is why nothing ever logs more of it than the host.
method: String"POST" (default), "PUT" or "PATCH". Matrix’s send-message API is
the reason this is configurable at all.
headers: BTreeMap<String, String>Extra request headers, e.g. Authorization. Applied after the
defaults, so an entry may override content-type.
body: StringThe request body, as a MiniJinja template. message (the rendered
webhook/<event>.j2), hook and every field of the event’s own
payload are in scope.
The default is the shape Slack, Mattermost and Teams all accept. Note
the tojson filter: .j2 templates have auto-escaping off, so a
message holding a quote or a newline needs it to stay valid JSON.
events: Vec<String>§timeout_ms: u64Trait Implementations§
Source§impl Clone for WebhookNotifyConfig
impl Clone for WebhookNotifyConfig
Source§fn clone(&self) -> WebhookNotifyConfig
fn clone(&self) -> WebhookNotifyConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WebhookNotifyConfig
impl Debug for WebhookNotifyConfig
Source§impl Default for WebhookNotifyConfig
impl Default for WebhookNotifyConfig
Source§impl<'de> Deserialize<'de> for WebhookNotifyConfigwhere
WebhookNotifyConfig: Default,
impl<'de> Deserialize<'de> for WebhookNotifyConfigwhere
WebhookNotifyConfig: Default,
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 WebhookNotifyConfig
impl RefUnwindSafe for WebhookNotifyConfig
impl Send for WebhookNotifyConfig
impl Sync for WebhookNotifyConfig
impl Unpin for WebhookNotifyConfig
impl UnsafeUnpin for WebhookNotifyConfig
impl UnwindSafe for WebhookNotifyConfig
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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