notifications

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UnknownLevel = iota
	InfoLevel
	WarnLevel
	ErrorLevel
	CriticalLevel
)

Variables

This section is empty.

Functions

func NewRouter

func NewRouter() *router

Types

type Exec

type Exec struct {
	Command   string
	Arguments []string
}

func (*Exec) Dispatch

func (self *Exec) Dispatch(note Notification)

func (*Exec) Start

func (self *Exec) Start()

func (*Exec) Stop

func (self *Exec) Stop()

type Nma

type Nma struct {
	ApiKey string
	// contains filtered or unexported fields
}

NMA - NotifyMyAndroid

func (*Nma) Dispatch

func (self *Nma) Dispatch(note Notification)

func (*Nma) Start

func (self *Nma) Start()

func (*Nma) Stop

func (self *Nma) Stop()

type Notification

type Notification struct {
	Source     string `json:",omitempty"`
	SourceUuid string `json:",omitempty"`
	Level      NotificationLevel
	Message    string
}

func NewNotification

func NewNotification(level NotificationLevel, message string) *Notification

type NotificationLevel

type NotificationLevel uint8

func NewNotificationLevel

func NewNotificationLevel(level string) NotificationLevel

func (NotificationLevel) MarshalJSON

func (l NotificationLevel) MarshalJSON() ([]byte, error)

func (NotificationLevel) String

func (level NotificationLevel) String() string

func (*NotificationLevel) UnmarshalJSON

func (l *NotificationLevel) UnmarshalJSON(data []byte) error

type Router

type Router interface {
	Dispatch(msg Notification)
	Send(data interface{})
}

type Smtp

type Smtp struct {
	Server             string `default:localhost`
	Username           string
	Password           string
	Port               int    `default:25`
	Sender             string `default:stampzilla`
	To                 string `default:stampzilla`
	InsecureSkipVerify bool
}

func (*Smtp) Dispatch

func (self *Smtp) Dispatch(note Notification)

func (*Smtp) Start

func (self *Smtp) Start()

func (*Smtp) Stop

func (self *Smtp) Stop()

type Transport

type Transport interface {
	Start()
	Dispatch(note Notification)
	Stop()
}

Jump to

Keyboard shortcuts

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