notify

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MultiNotifier added in v0.4.0

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

MultiNotifier sends notifications to multiple notifiers.

func NewMultiNotifier added in v0.4.0

func NewMultiNotifier(notifiers ...Notifier) *MultiNotifier

NewMultiNotifier creates a new MultiNotifier.

func (*MultiNotifier) Send added in v0.4.0

func (mn *MultiNotifier) Send(ctx context.Context, n Notification) error

Send sends the notification to all notifiers. It stops and returns the error if any of the notifiers fail.

type NilNotifier

type NilNotifier struct{}

func NewNilNotifier

func NewNilNotifier() *NilNotifier

func (*NilNotifier) Send

func (nn *NilNotifier) Send(ctx context.Context, n Notification) error

type Notification

type Notification struct {
	Timestamp time.Time
	Type      Type
	Source    string
	Message   string
	Fields    map[string]interface{}
}

type Notifier

type Notifier interface {
	Send(ctx context.Context, n Notification) error
}

Notifier defines the contract for sending alarms and metrics. Implementations of this interface are responsible for formatting and dispatching notifications to their respective backends. Implementations MUST be safe for concurrent use by multiple goroutines.

type Type

type Type int
const (
	Alarm Type = iota
	Metric
)

func (Type) String

func (nt Type) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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