pub struct WebhookConfig {
pub enabled: Option<bool>,
pub url: Option<String>,
pub secret: Option<String>,
pub events: Option<Vec<WebhookEventSubscription>>,
pub timeout_secs: Option<u32>,
pub retry_count: Option<u32>,
pub retry_backoff_ms: Option<u32>,
pub queue_capacity: Option<u32>,
pub parallel_queue_multiplier: Option<f32>,
pub queue_policy: Option<WebhookQueuePolicy>,
}Expand description
Webhook configuration for HTTP task event notifications.
Fields§
§enabled: Option<bool>Enable webhook notifications (default: false).
url: Option<String>Webhook endpoint URL (required when enabled).
secret: Option<String>Secret key for HMAC-SHA256 signature generation. When set, webhooks include an X-Ralph-Signature header.
events: Option<Vec<WebhookEventSubscription>>Events to subscribe to (default: legacy task events only).
timeout_secs: Option<u32>Request timeout in seconds (default: 30, max: 300).
retry_count: Option<u32>Number of retry attempts for failed deliveries (default: 3, max: 10).
retry_backoff_ms: Option<u32>Retry backoff base in milliseconds (default: 1000, max: 30000).
queue_capacity: Option<u32>Maximum number of pending webhooks in the delivery queue (default: 500, range: 10-10000).
parallel_queue_multiplier: Option<f32>Multiplier for queue capacity in parallel mode (default: 2.0, range: 1.0-10.0). When running with N parallel workers, effective capacity = queue_capacity * max(1, workers * multiplier). Set higher (e.g., 3.0) if webhook endpoint is slow or unreliable.
queue_policy: Option<WebhookQueuePolicy>Backpressure policy when queue is full (default: drop_oldest).
- drop_oldest: Drop new webhooks when full (preserves existing queue contents)
- drop_new: Drop the new webhook if queue is full
- block_with_timeout: Block sender briefly (100ms), then drop if still full
Implementations§
Source§impl WebhookConfig
impl WebhookConfig
pub fn merge_from(&mut self, other: Self)
Sourcepub fn is_event_enabled(&self, event: &str) -> bool
pub fn is_event_enabled(&self, event: &str) -> bool
Check if a specific event type is enabled.
Event filtering behavior:
- If webhooks are disabled, no events are sent.
- If
eventsisNone: only legacy task events are enabled (backward compatible). - If
eventsisSome([...]): only those events are enabled; use["*"]to enable all.
Trait Implementations§
Source§impl Clone for WebhookConfig
impl Clone for WebhookConfig
Source§fn clone(&self) -> WebhookConfig
fn clone(&self) -> WebhookConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WebhookConfig
impl Debug for WebhookConfig
Source§impl Default for WebhookConfig
impl Default for WebhookConfig
Source§fn default() -> WebhookConfig
fn default() -> WebhookConfig
Source§impl<'de> Deserialize<'de> for WebhookConfigwhere
WebhookConfig: Default,
impl<'de> Deserialize<'de> for WebhookConfigwhere
WebhookConfig: 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>,
Source§impl JsonSchema for WebhookConfig
impl JsonSchema for WebhookConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more