alert

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2016 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FIXED = 1 + iota
	THRESHOLD
)
View Source
const (
	Namespace = "Alert"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertEventListener

type AlertEventListener interface {
	OnAlert(n *AlertMessage)
}

type AlertManager

type AlertManager struct {
	graph.DefaultGraphListener
	Graph        *graph.Graph
	AlertHandler api.ApiHandler
	// contains filtered or unexported fields
}

func NewAlertManager

func NewAlertManager(g *graph.Graph, ah api.ApiHandler) *AlertManager

func (*AlertManager) AddEventListener

func (a *AlertManager) AddEventListener(l AlertEventListener)

func (*AlertManager) DelEventListener

func (a *AlertManager) DelEventListener(l AlertEventListener)

func (*AlertManager) DeleteAlert

func (a *AlertManager) DeleteAlert(id string)

func (*AlertManager) EvalNodes

func (a *AlertManager) EvalNodes()

func (*AlertManager) OnNodeAdded

func (a *AlertManager) OnNodeAdded(n *graph.Node)

func (*AlertManager) OnNodeUpdated

func (a *AlertManager) OnNodeUpdated(n *graph.Node)

func (*AlertManager) SetAlert

func (a *AlertManager) SetAlert(at *api.Alert)

func (*AlertManager) Start

func (a *AlertManager) Start()

func (*AlertManager) Stop

func (a *AlertManager) Stop()

type AlertMessage

type AlertMessage struct {
	UUID       string
	Type       int
	Timestamp  time.Time
	Count      int
	Reason     string
	ReasonData interface{}
}

func (*AlertMessage) Marshal

func (am *AlertMessage) Marshal() []byte

func (*AlertMessage) String

func (am *AlertMessage) String() string

type AlertServer added in v0.4.0

type AlertServer struct {
	shttp.DefaultWSServerEventHandler
	WSServer     *shttp.WSServer
	AlertManager *AlertManager
	// contains filtered or unexported fields
}

func NewServer

func NewServer(a *AlertManager, server *shttp.WSServer) *AlertServer

func (*AlertServer) OnRegisterClient added in v0.4.0

func (a *AlertServer) OnRegisterClient(c *shttp.WSClient)

func (*AlertServer) OnUnregisterClient added in v0.4.0

func (a *AlertServer) OnUnregisterClient(c *shttp.WSClient)

Jump to

Keyboard shortcuts

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