func Register(rtr *mux.Router, bus *eventbus.EventBus) { rtr.HandleFunc("/ws", upgradeHandler).Methods("GET") bus.RegisterHandler(serviceStateChanged) bus.RegisterHandler(viewStateChanged) go h.run() }
func RegisterAlerters(bus *eventbus.EventBus, cfg config.Config) { alerters = []Alerter{ NewMailAlerter(cfg), NewSlackhookAlerter(cfg), NewWebhooksAlerter(cfg), } alerts = cfg.Alerts bus.RegisterHandler(ViewStateChanged) }
func RegisterMetrics(bus *eventbus.EventBus, m metrics.Metrics) { counters = m bus.RegisterHandler(ServiceStateChanged) bus.RegisterHandler(ViewStateChanged) }
func (el *EventLog) Register(bus *eventbus.EventBus) { bus.RegisterHandler( el.eventHandler, service.ServiceStateChangedEvent{}, service.ViewStateChangedEvent{}) }