channels

package
v0.0.0-...-cda4157 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SeverityColor

func SeverityColor(severity string) string

SeverityColor returns a hex color for the severity level.

func SeverityEmoji

func SeverityEmoji(severity string) string

SeverityEmoji returns an emoji for the severity level.

Types

type ChannelSender

type ChannelSender interface {
	Send(ctx context.Context, msg *NotificationMessage) error
	ValidateConfig() error
	Type() string
}

ChannelSender defines the interface for notification delivery.

func NewSender

func NewSender(channelType string, config map[string]string) (ChannelSender, error)

NewSender creates a ChannelSender for the given type and config.

type EmailSender

type EmailSender struct {
	// contains filtered or unexported fields
}

EmailSender sends notifications via SMTP.

func (*EmailSender) Send

func (*EmailSender) Type

func (e *EmailSender) Type() string

func (*EmailSender) ValidateConfig

func (e *EmailSender) ValidateConfig() error

type NotificationMessage

type NotificationMessage struct {
	Title     string            `json:"title"`
	Body      string            `json:"body"`
	Severity  string            `json:"severity"`
	IssueName string            `json:"issueName"`
	Namespace string            `json:"namespace"`
	Resource  string            `json:"resource"`
	State     string            `json:"state"`
	Timestamp time.Time         `json:"timestamp"`
	Fields    map[string]string `json:"fields,omitempty"`
	Color     string            `json:"color"`
	URL       string            `json:"url,omitempty"`
}

NotificationMessage is the structured message sent through channels.

type OpsGenieSender

type OpsGenieSender struct {
	// contains filtered or unexported fields
}

OpsGenieSender sends notifications via OpsGenie Alert API.

func (*OpsGenieSender) Send

func (*OpsGenieSender) Type

func (o *OpsGenieSender) Type() string

func (*OpsGenieSender) ValidateConfig

func (o *OpsGenieSender) ValidateConfig() error

type PagerDutySender

type PagerDutySender struct {
	// contains filtered or unexported fields
}

PagerDutySender sends notifications via PagerDuty Events API v2.

func (*PagerDutySender) Send

func (*PagerDutySender) Type

func (p *PagerDutySender) Type() string

func (*PagerDutySender) ValidateConfig

func (p *PagerDutySender) ValidateConfig() error

type SlackSender

type SlackSender struct {
	// contains filtered or unexported fields
}

SlackSender sends notifications via Slack Incoming Webhooks.

func (*SlackSender) Send

func (*SlackSender) Type

func (s *SlackSender) Type() string

func (*SlackSender) ValidateConfig

func (s *SlackSender) ValidateConfig() error

type TeamsSender

type TeamsSender struct {
	// contains filtered or unexported fields
}

TeamsSender sends notifications via Microsoft Teams Incoming Webhooks (Adaptive Cards).

func (*TeamsSender) Send

func (*TeamsSender) Type

func (t *TeamsSender) Type() string

func (*TeamsSender) ValidateConfig

func (t *TeamsSender) ValidateConfig() error

type WebhookSender

type WebhookSender struct {
	// contains filtered or unexported fields
}

WebhookSender sends notifications to a generic HTTP webhook.

func (*WebhookSender) Send

func (*WebhookSender) Type

func (w *WebhookSender) Type() string

func (*WebhookSender) ValidateConfig

func (w *WebhookSender) ValidateConfig() error

Jump to

Keyboard shortcuts

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