service

package
v0.0.0-...-3651c1b Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2017 License: Apache-2.0 Imports: 11 Imported by: 6

Documentation

Index

Constants

View Source
const (
	MAX_UNPROCESSED_PACKETS = 1000
)
View Source
const ServiceNamePattern = "[a-z0-9._-]+"

Variables

View Source
var NAME_RE = regexp.MustCompile("\\$([a-z]+)")
View Source
var (
	StateMap = map[string]int{
		model.StateNew:   0,
		model.StateOk:    1,
		model.StateError: 2,
		model.StateMuted: 3,
	}
)
View Source
var VAR_RE = regexp.MustCompile("\\\\\\$([a-z]+)")

Functions

This section is empty.

Types

type ServiceCallback

type ServiceCallback interface {
	OnUpdate(ts int64, update model.Update)

	OnServiceAdded(ts int64, service model.Service)
	OnServiceUpdated(ts int64, oldService, newService model.Service)
	OnServiceRemoved(ts int64, service model.Service)

	OnAlarmAdded(ts int64, alarm model.Alarm, config config.ConfigAlarm)
	OnAlarmUpdated(ts int64, oldAlarm, newAlarm model.Alarm, config config.ConfigAlarm)
	OnAlarmRemoved(ts int64, alarm model.Alarm, config config.ConfigAlarm)
}

func NewDebugLogger

func NewDebugLogger() ServiceCallback

func NewMetricsReporter

func NewMetricsReporter(m metrics.Metrics) ServiceCallback

type Services

type Services interface {
	Subscribe(cb ServiceCallback)
	Update(update *model.Update)

	GetServices() []model.Service
	GetServicesInAlarm(alarm string) []model.Service
	GetService(name string) *model.Service
	GetAlarms() []model.Alarm
	GetAlarm(name string) *model.Alarm
}

func NewServices

func NewServices(beiface backend.Backend, cfg config.Config, notifier notify.Notifier) Services

type ServicesImpl

type ServicesImpl struct {
	// contains filtered or unexported fields
}

func (*ServicesImpl) GetAlarm

func (c *ServicesImpl) GetAlarm(name string) *model.Alarm

func (*ServicesImpl) GetAlarms

func (c *ServicesImpl) GetAlarms() []model.Alarm

func (*ServicesImpl) GetService

func (c *ServicesImpl) GetService(name string) *model.Service

func (*ServicesImpl) GetServices

func (c *ServicesImpl) GetServices() []model.Service

func (*ServicesImpl) GetServicesInAlarm

func (c *ServicesImpl) GetServicesInAlarm(alarm string) []model.Service

func (*ServicesImpl) Monitor

func (svcs *ServicesImpl) Monitor(cfg config.Config, notifier notify.Notifier, be backend.Backend)

func (*ServicesImpl) Subscribe

func (c *ServicesImpl) Subscribe(cb ServiceCallback)

func (*ServicesImpl) Update

func (c *ServicesImpl) Update(update *model.Update)

Jump to

Keyboard shortcuts

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