notify

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Level

type Level int

Level controls which events trigger notifications.

const (
	LevelNone Level = iota
	LevelError
	LevelAll
)

func ParseLevel

func ParseLevel(s string) Level

ParseLevel converts a string to a notification Level. Unknown values default to LevelNone.

type Notifier

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

Notifier sends backup failure notifications via shoutrrr.

func New

func New(urls []string, level Level, logger *slog.Logger) (*Notifier, error)

New creates a Notifier from shoutrrr service URLs. If urls is empty or level is LevelNone, returns a no-op Notifier (notifications disabled). Unknown services in the URLs cause a creation error.

func (*Notifier) SendBackupError

func (n *Notifier) SendBackupError(ctrName, msg string)

SendBackupError sends a notification about a backup failure. The notifier handles shoutrrr errors internally - they are logged as warnings but never propagated to the caller.

func (*Notifier) SendInfo

func (n *Notifier) SendInfo(title, msg string)

SendInfo sends an informational notification. Only delivered when Level is LevelAll.

Jump to

Keyboard shortcuts

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