pub struct WebhookSink { /* private fields */ }Expand description
HTTP webhook audit sink for SIEM integration.
Events are queued into a bounded channel and delivered asynchronously by
a background thread. If the channel is full, behaviour depends on the
DeliveryGuarantee mode:
BestEffort: event is dropped (non-blocking).AtLeastOnce: event overflows to a disk-backed journal for later delivery.
Implementations§
Source§impl WebhookSink
impl WebhookSink
Sourcepub fn new(config: WebhookConfig) -> Self
pub fn new(config: WebhookConfig) -> Self
Create and start a webhook sink.
Spawns a background thread that consumes events from the channel and POSTs them to the configured URL.
Sourcepub fn delivered_count(&self) -> u64
pub fn delivered_count(&self) -> u64
Number of successfully delivered events.
Sourcepub fn dropped_count(&self) -> u64
pub fn dropped_count(&self) -> u64
Number of dropped events (channel full or delivery failure).
Trait Implementations§
Source§impl AuditSink for WebhookSink
impl AuditSink for WebhookSink
Source§impl Drop for WebhookSink
impl Drop for WebhookSink
Auto Trait Implementations§
impl !Freeze for WebhookSink
impl !RefUnwindSafe for WebhookSink
impl !UnwindSafe for WebhookSink
impl Send for WebhookSink
impl Sync for WebhookSink
impl Unpin for WebhookSink
impl UnsafeUnpin for WebhookSink
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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