notifier

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadAndRunNotifiers

func LoadAndRunNotifiers(ctx context.Context, machineName string, notifierCfgList []Config, messageChan <-chan Message)

Types

type Config

type Config struct {
	Type   string `json:"type"`
	Params params `json:"params" default:"{}"`
}

type ConsoleNotifier

type ConsoleNotifier struct {
}

func (*ConsoleNotifier) Send

func (l *ConsoleNotifier) Send(message Message) error

type Message

type Message struct {
	Type    MessageType
	Title   string
	Message string
}

func MakeAggregatedMessage

func MakeAggregatedMessage(msgList []Message) Message

func MakeMessage

func MakeMessage(type_ MessageType, descriptionFormat string, args ...any) Message

type MessageType

type MessageType uint
const (
	Undefined MessageType = iota
	Notification
	Failure
	Recovery
	Aggregate
)

func (MessageType) String

func (i MessageType) String() string

type Notifier

type Notifier interface {
	Send(message Message) error
}

func LoadNotifierFromConfig

func LoadNotifierFromConfig(cfg Config) (Notifier, error)

func NewConsoleNotifier

func NewConsoleNotifier() Notifier

func NewShoutrrr

func NewShoutrrr(params params) (Notifier, error)

type Shoutrrr

type Shoutrrr struct {
	Url string `json:"url"`
	// contains filtered or unexported fields
}

func (*Shoutrrr) Send

func (shoutrrr *Shoutrrr) Send(message Message) error

Jump to

Keyboard shortcuts

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