Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildDefaults ¶
BuildDefaults builds a list of channels and their respective timeouts from a Channels map. The margin argument indicates how many updates can be missed before an alert is fired.
If a channel name is invalid (i.e., not specified in channelNames), an error is returned.
func MustBuildDefaults ¶
MustBuildDefaults builds a list of channels and their respective timeouts from a Channels map. The margin argument indicates how many updates can be missed before an alert is fired. MustBuildDefaults panics if an error occurs.
Types ¶
type Channels ¶
Channels define the channels to watch for updates, and their respective timeouts
func ParseChannels ¶
ParseChannels parses a list of channels and their respective timeouts.
type Watchdog ¶
type Watchdog struct {
// contains filtered or unexported fields
}
Watchdog watches for updates on channels and fires alerts if no update is received for a while.
The channels are specified as a list of comma-separated strings, where the first part is the channel name and the second part is the timeout for the channel. If the timeout is not specified, the default is 1 minute.
The channels are:
tado: The Tado collector channel. solaredge: The Solaredge collector channel. homewizard: The HomeWizard 2 collector channel.
func New ¶
func New( channels Channels, alertManagerURL string, checkInterval time.Duration, httpClient *http.Client, redisClient pubsub.RedisClient, r prometheus.Registerer, logger *slog.Logger, ) *Watchdog
New creates a new Watchdog.