notify

package
v0.19.6 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 Desktop added in v0.18.1

type Desktop struct{}

func (Desktop) Alert added in v0.18.1

func (d Desktop) Alert(title, message string)

func (Desktop) Beep added in v0.18.1

func (d Desktop) Beep()

func (Desktop) Notify added in v0.18.1

func (d Desktop) Notify(title, message string)

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