Documentation ¶
Index ¶
- Constants
- Variables
- type ServiceCallback
- type Services
- type ServicesImpl
- func (c *ServicesImpl) GetAlarm(name string) *model.Alarm
- func (c *ServicesImpl) GetAlarms() []model.Alarm
- func (c *ServicesImpl) GetService(name string) *model.Service
- func (c *ServicesImpl) GetServices() []model.Service
- func (c *ServicesImpl) GetServicesInAlarm(alarm string) []model.Service
- func (svcs *ServicesImpl) Monitor(cfg config.Config, notifier notify.Notifier, be backend.Backend)
- func (c *ServicesImpl) Subscribe(cb ServiceCallback)
- func (c *ServicesImpl) Update(update *model.Update)
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 ServicesImpl ¶
type ServicesImpl struct {
// contains filtered or unexported fields
}
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) Subscribe ¶
func (c *ServicesImpl) Subscribe(cb ServiceCallback)
func (*ServicesImpl) Update ¶
func (c *ServicesImpl) Update(update *model.Update)
Click to show internal directories.
Click to hide internal directories.