alert

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: Apache-2.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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