예제 #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()
}
예제 #2
0
func RegisterAlerters(bus *eventbus.EventBus, cfg config.Config) {
	alerters = []Alerter{
		NewMailAlerter(cfg),
		NewSlackhookAlerter(cfg),
		NewWebhooksAlerter(cfg),
	}
	alerts = cfg.Alerts
	bus.RegisterHandler(ViewStateChanged)
}
예제 #3
0
func RegisterMetrics(bus *eventbus.EventBus, m metrics.Metrics) {
	counters = m
	bus.RegisterHandler(ServiceStateChanged)
	bus.RegisterHandler(ViewStateChanged)
}
예제 #4
0
func (el *EventLog) Register(bus *eventbus.EventBus) {
	bus.RegisterHandler(
		el.eventHandler,
		service.ServiceStateChangedEvent{},
		service.ViewStateChangedEvent{})
}