notify

package
v0.23.1 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2025 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChannelSend added in v0.21.1

func ChannelSend(uid types.Uid, name string, message Message) error

func List

func List() map[string]Notifyer

func ParseSchema

func ParseSchema(testString string) (string, error)

func ParseTemplate

func ParseTemplate(testString string, templates []string) (types.KV, error)

func Register

func Register(id string, notifyer Notifyer)

func Send

func Send(text string, message Message) error

Types

type Message

type Message struct {
	Title    string
	Body     string
	Url      string
	Priority Priority
}

type Notifyer

type Notifyer interface {
	// Protocol Define protocol
	Protocol() string
	// Templates Define object templates
	Templates() []string
	// Send notify
	Send(tokens types.KV, message Message) error
}

type Priority

type Priority int32
const (
	Low Priority = iota + 1
	Moderate
	Normal
	High
	Emergency
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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