webhooks

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleWebhook

func HandleWebhook(msg string, stats *pipelines.LogBurst)

HandleWebhook sends burst notifications to the configured URLs (Discord or Slack).

Parameters:

  • msg: burst category (e.g., 'D', 'AGGREGATE_TRAFFIC').
  • stats: burst statistics (Count, WindowStart, AlertsSent, LastAlertTime).

Returns:

  • void: the functions sends HTTP request but does not return any value.

The function performs:

  • Iterates over each URL in 'options.Config.WebHookUrls'.

  • If the URL start with 'https://discord.com', it constructs a Discord-formatted payload using types from the pkg (WebhookDiscord, OptionsEmbedsDiscord, AuthorOptionsEmbedsDiscord, FieldEmbedsDiscord, FooterEmbedsDiscord), serializes it to JSON, and calls sentData to send it.

  • If the URL start with 'https://hooks.slack.com', it constructs a Slack-formatted payload (header, section, divider, context,blocks), serializes it to JSON, and calls sentData.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL