alert

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	// Get will return the currently cached alerts for a given node. An error
	// will be returned if the cache is not populated, node specific filters
	// cannot be run, or if the last retrieval resulted in an error. The time
	// returned is the time of the last retrieval attempt.
	Get(nodeName string) (models.GettableAlerts, time.Time, error)
}

Cache outlines an interface to interact with cached alerts

type Syncer

type Syncer interface {
	manager.LeaderElectionRunnable
	manager.Runnable
	Cache
	// SyncOnce enables the cache to be initialized before use by the Manager
	SyncOnce()
}

Syncer is an interface designed to be run by a manager.Manager that also provides a Cache interface

func NewSyncer

func NewSyncer(
	alertClient alertClient,
	log logr.Logger,
	prom prometheus.Registerer,
	receiver,
	nodeTemplate string,
	syncInterval time.Duration,
	fetchSilenced bool,
) (Syncer, error)

NewSyncer provides an implementation of Syncer that gets alerts at syncInterval

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL