Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

brokkr-broker::dal::webhook_subscriptions Rust

Data Access Layer for WebhookSubscription operations.

This module provides functionality to interact with the webhook_subscriptions table. It includes methods for creating, updating, deleting, and querying webhook subscriptions.

Structs

brokkr-broker::dal::webhook_subscriptions::WebhookSubscriptionsDAL<’a>

pub

Data Access Layer for WebhookSubscription operations.

Fields

NameTypeDescription
dal& 'a DALReference to the main DAL instance.

Functions

brokkr-broker::dal::webhook_subscriptions::matches_event_pattern

private

#![allow(unused)]
fn main() {
fn matches_event_pattern (pattern : & str , event_type : & str) -> bool
}

Matches an event type against a pattern.

Patterns support:

  • Exact match: “health.degraded” matches “health.degraded”
  • Wildcard suffix: “health.*” matches “health.degraded”, “health.failing”, etc.
  • Full wildcard: “*” matches everything
Source
#![allow(unused)]
fn main() {
fn matches_event_pattern(pattern: &str, event_type: &str) -> bool {
    if pattern == "*" {
        return true;
    }

    if let Some(prefix) = pattern.strip_suffix(".*") {
        return event_type.starts_with(prefix) && event_type[prefix.len()..].starts_with('.');
    }

    pattern == event_type
}
}