notify

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package notify provides a common interface for sending Agent notifications.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Level

type Level int

Level is the severity of a notification.

const (
	LevelInfo  Level = iota // information
	LevelWarn               // warning
	LevelError              // error / alert
)

type Message

type Message struct {
	Title string
	Body  string
	Level Level
}

Message is the body of a notification.

type Multi

type Multi struct {
	Notifiers []Notifier
}

Multi fans a notification out to several Notifiers. On an error it records the first one and keeps calling the remaining Notifiers, finally returning the first error.

func (*Multi) Notify

func (m *Multi) Notify(ctx context.Context, msg Message) error

type Notifier

type Notifier interface {
	Notify(ctx context.Context, msg Message) error
}

Notifier sends notifications to external channels (Telegram, webhooks and so on).

Directories

Path Synopsis
Package telegram implements notify.Notifier with the Telegram Bot API.
Package telegram implements notify.Notifier with the Telegram Bot API.
Package webhook implements notify.Notifier with an HTTP POST of a JSON body.
Package webhook implements notify.Notifier with an HTTP POST of a JSON body.

Jump to

Keyboard shortcuts

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