models

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2016 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventAlert

type EventAlert interface{}

type EventHandler

type EventHandler interface {
	// HandleEvent sinks event.
	HandleEvent([]Sink, *api.Event)
	// AlertEventReason returns a unique string representing an alert event reason.
	AlertEventReason() string
	// Reason returns a string describing the event reason in short.
	Reason() string
}

type NodeEventAlert

type NodeEventAlert struct {
	Kind          string            `json:"kind"`
	Name          string            `json:"name"`
	Namespace     string            `json:"namespace"`
	Reason        string            `json:"reason"`
	LastTimestamp string            `json:"last_timestamp"`
	Message       string            `json:"message"`
	Environment   map[string]string `json:"environment"`
}

func (NodeEventAlert) String

func (nea NodeEventAlert) String() string

type PodEventAlert

type PodEventAlert struct {
	Kind          string            `json:"kind"`
	Name          string            `json:"name"`
	Namespace     string            `json:"namespace"`
	Host          string            `json:"host"`
	Reason        string            `json:"reason"`
	LastTimestamp string            `json:"last_timestamp"`
	Message       string            `json:"message"`
	Environment   map[string]string `json:"environment"`
}

func (PodEventAlert) String

func (pea PodEventAlert) String() string

type Sink

type Sink interface {
	// Sink sends alter to specific destination.
	Sink(kind string, eventAlert EventAlert)
	// Name returns the sink name.
	Name() string
}

type Source

type Source interface {
	// Start starts to collect event and send it to eventChan.
	Start(eventChan chan<- *api.Event)
	// Stop stops Source gracefully.
	Stop()
}

Jump to

Keyboard shortcuts

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