notifications

package
v0.12.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendEmailWithConfig

func SendEmailWithConfig(_ context.Context, config *NotificationChannelConfig, subject, body string) error

SendEmailWithConfig sends an alert email using the provided configuration.

func SendWebhookWithConfig added in v0.12.0

func SendWebhookWithConfig(ctx context.Context, config *WebhookConfig, alertDetails map[string]interface{}) error

SendWebhookWithConfig sends an alert webhook using the provided configuration. It sends the alertDetails JSON object as the request body.

Types

type EmailConfig

type EmailConfig struct {
	SMTP            SMTPConfig
	To              []string
	SubjectTemplate string
	BodyTemplate    string
}

EmailConfig holds email-specific configuration

type NotificationChannelConfig

type NotificationChannelConfig struct {
	Type    string // "email" or "webhook"
	Email   EmailConfig
	Webhook WebhookConfig
}

NotificationChannelConfig combines email and webhook configuration

type SMTPConfig

type SMTPConfig struct {
	Host     string
	Port     int
	Username string
	Password string
	From     string
}

SMTPConfig holds SMTP configuration for sending emails

type WebhookConfig added in v0.12.0

type WebhookConfig struct {
	URL             string
	Headers         map[string]string
	PayloadTemplate string // Optional JSON template with CEL expressions
}

WebhookConfig holds webhook configuration for sending alerts

Jump to

Keyboard shortcuts

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