Example #1
0
func Register(rtr *mux.Router, bus *eventbus.EventBus) {
	rtr.HandleFunc("/ws", upgradeHandler).Methods("GET")
	bus.RegisterHandler(serviceStateChanged)
	bus.RegisterHandler(viewStateChanged)

	go h.run()
}
Example #2
0
func RegisterAlerters(bus *eventbus.EventBus, cfg config.Config) {
	alerters = []Alerter{
		NewMailAlerter(cfg),
		NewSlackhookAlerter(cfg),
		NewWebhooksAlerter(cfg),
	}
	alerts = cfg.Alerts
	bus.RegisterHandler(ViewStateChanged)
}
Example #3
0
func RegisterMetrics(bus *eventbus.EventBus, m metrics.Metrics) {
	counters = m
	bus.RegisterHandler(ServiceStateChanged)
	bus.RegisterHandler(ViewStateChanged)
}
Example #4
0
func (el *EventLog) Register(bus *eventbus.EventBus) {
	bus.RegisterHandler(
		el.eventHandler,
		service.ServiceStateChangedEvent{},
		service.ViewStateChangedEvent{})
}