handlers

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2020 License: Apache-2.0 Imports: 8 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Map = map[string]interface{}{
	"default":    &Default{},
	"slack":      &slack.Slack{},
	"hipchat":    &hipchat.Hipchat{},
	"mattermost": &mattermost.Mattermost{},
	"flock":      &flock.Flock{},
	"webhook":    &webhook.Webhook{},
	"ms-teams":   &msteam.MSTeams{},
	"smtp":       &smtp.SMTP{},
}

Map maps each event handler function to a name for easily lookup

Functions

This section is empty.

Types

type Default

type Default struct {
}

Default handler implements Handler interface, print each event with JSON format

func (*Default) Init

func (d *Default) Init(c *config.Config) error

Init initializes handler configuration Do nothing for default handler

func (*Default) ObjectCreated

func (d *Default) ObjectCreated(obj interface{})

ObjectCreated sends events on object creation

func (*Default) ObjectDeleted

func (d *Default) ObjectDeleted(obj interface{})

ObjectDeleted sends events on object deletion

func (*Default) ObjectUpdated

func (d *Default) ObjectUpdated(oldObj, newObj interface{})

ObjectUpdated sends events on object updation

func (*Default) TestHandler added in v0.1.0

func (d *Default) TestHandler()

TestHandler tests the handler configurarion by sending test messages.

type Handler

type Handler interface {
	Init(c *config.Config) error
	ObjectCreated(obj interface{})
	ObjectDeleted(obj interface{})
	ObjectUpdated(oldObj, newObj interface{})
	TestHandler()
}

Handler is implemented by any handler. The Handle method is used to process event

Directories

Path Synopsis
Package smtp implements an email notification handler for kubewatch.
Package smtp implements an email notification handler for kubewatch.

Jump to

Keyboard shortcuts

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