handlers

package
v0.0.0-...-41dce0b Latest Latest
Warning

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

Go to latest
Published: May 1, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Map = map[string]interface{}{
	"default":  &Default{},
	"rabbitmq": &rabbitmq.RabbitMq{},
	"influxdb": &influxdb.InfluxDB{},
	"alert":    &alert.Alert{},
	"webhook":  &webhook.Webhook{},
}

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 Handlers 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 event.Event)

func (*Default) ObjectDeleted

func (d *Default) ObjectDeleted(obj event.Event)

func (*Default) ObjectUpdated

func (d *Default) ObjectUpdated(event.Event)

type Handler

type Handler interface {
	Init(c config.Config) error
	ObjectCreated(obj event.Event)
	ObjectDeleted(obj event.Event)
	ObjectUpdated(obj event.Event)
}

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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