alert

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: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppOwner = "appowner"
	Normal   = "normal"
	Admin    = "admin"
	Warning  = "warning"
	Unknown  = "unknown"
)

Variables

This section is empty.

Functions

func ClassifyEvent

func ClassifyEvent(msg event.Event) (describe, receiverType string)

ClassifyEvent 根据event/alltypes中的定义对事件进行分级和更友好的描述,对于未定义的reason则用reason作为描述,级别为Warning的未知事件将发给管理员。

Types

type Alert

type Alert struct {
	EnableAdminAlert    bool
	EnableAppOwnerAlert bool
	AlertSpeaker        string
}

func (*Alert) AlertWorker

func (a *Alert) AlertWorker(msg event.Event) error

func (*Alert) Init

func (a *Alert) Init(c config.Config) error

func (*Alert) ObjectCreated

func (a *Alert) ObjectCreated(obj event.Event)

func (*Alert) ObjectDeleted

func (a *Alert) ObjectDeleted(obj event.Event)

func (*Alert) ObjectUpdated

func (a *Alert) ObjectUpdated(obj event.Event)

type AlertMsg

type AlertMsg struct {
	event.Event
	Subject string `json:"subject"`
}

Jump to

Keyboard shortcuts

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