notification

package
v0.0.0-...-03dd7be Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2017 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NotifierTypes = map[string]Notifier{
	"shell": &ShellNotifier{},
	"log":   &LogNotifier{},
}

Functions

func Initialize

func Initialize(nbs []*NotifierBackend) error

func Send

func Send(e *event.Event) error

Types

type LogNotifier

type LogNotifier struct {
	// contains filtered or unexported fields
}

Log notifier dumps events to the specified file destination. Arguments:

"destination": log file path or STDOUT or STDERR (optional, default is STDERR)

func (*LogNotifier) Destruct

func (l *LogNotifier) Destruct() error

func (*LogNotifier) Initialize

func (l *LogNotifier) Initialize(args map[string]string) error

func (*LogNotifier) Notify

func (l *LogNotifier) Notify(e *event.Event) error

type Notifier

type Notifier interface {
	Initialize(map[string]string) error
	Notify(*event.Event) error
	Destruct() error
}

type NotifierBackend

type NotifierBackend struct {
	Type string
	Args map[string]string
	// contains filtered or unexported fields
}

type ShellNotifier

type ShellNotifier struct {
	// contains filtered or unexported fields
}

Shell notifier executes commands on fail and pass events. Event message is acessible from the commands with the %q format string. Arguments:

"fail_command": command to run on fail event
"pass_command": command to run on pass event

TODO implement proper shell escaping instead of relying on golang's format strings

func (*ShellNotifier) Destruct

func (_ *ShellNotifier) Destruct() error

func (*ShellNotifier) Initialize

func (s *ShellNotifier) Initialize(args map[string]string) error

func (*ShellNotifier) Notify

func (s *ShellNotifier) Notify(e *event.Event) error

Jump to

Keyboard shortcuts

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