converge/cmd/converge/notifier.go
Erik Brakkee 9d1c6d6616 prometheus support step 1
updates to documentation.
2024-08-07 20:50:17 +02:00

21 lines
526 B
Go

package main
import "converge/pkg/models"
type StateNotifier struct {
webNotificationChannel chan *models.State
prometheusNotificationChannel chan *models.State
}
func NewStateNotifier() *StateNotifier {
return &StateNotifier{
webNotificationChannel: make(chan *models.State, 10),
prometheusNotificationChannel: make(chan *models.State, 10),
}
}
func (notifier StateNotifier) Publish(state *models.State) {
notifier.webNotificationChannel <- state
notifier.prometheusNotificationChannel <- state
}