notifier

package
v0.0.0-...-09367bf Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notifier

type Notifier interface {
	Notify(context.Context, *config.Technical, ...*model.Alert) (bool, error)
	String() string
}

Notifier notifies about alerts under constraints of the given context. It returns an error if unsuccessful and a flag whether the error is recoverable. This information is useful for a retry logic.

func NewNotifiers

func NewNotifiers(log *wlog.Logger, nrs *notifiers.Notifiers) ([]Notifier, error)

type Queue

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

func NewQueue

func NewQueue(log *wlog.Logger, wait time.Duration, notifiers []Notifier) *Queue

func (*Queue) Notify

func (q *Queue) Notify(ctx context.Context, onduty *config.Technical, items ...*model.Alert) []*model.Alert

func (*Queue) Process

func (q *Queue) Process(ctx context.Context, onduty *config.Technical)

func (*Queue) Push

func (q *Queue) Push(v *model.Alert)

func (*Queue) Stop

func (q *Queue) Stop()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳