alerts

package
v0.0.0-...-ac41614 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: MIT Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alert

type Alert struct {
	Key       string      `json:"key"`
	Level     string      `json:"level"`
	Timestamp uint64      `json:"timestamp"`
	Metadata  interface{} `json:"metadata"`
	Status    bool        `json:"status"`
}

type AlertMap

type AlertMap struct {
	// contains filtered or unexported fields
}

func NewAlertMap

func NewAlertMap(alertStore AlertStore) *AlertMap

func (*AlertMap) ClearAlerts

func (alertMap *AlertMap) ClearAlerts(alerts map[string]Alert) error

Blocks calls to UpdateAlert()

func (*AlertMap) GetAlerts

func (alertMap *AlertMap) GetAlerts() (map[string]Alert, error)

func (*AlertMap) UpdateAlert

func (alertMap *AlertMap) UpdateAlert(alert Alert) error

type AlertStore

type AlertStore interface {
	Put(alert Alert) error
	DeleteAll(alerts map[string]Alert) error
	ForEach(func(alert Alert)) error
}

type AlertStoreImpl

type AlertStoreImpl struct {
	// contains filtered or unexported fields
}

func NewAlertStore

func NewAlertStore(storageDriver storage.StorageDriver) *AlertStoreImpl

func (*AlertStoreImpl) DeleteAll

func (alertStore *AlertStoreImpl) DeleteAll(alerts map[string]Alert) error

func (*AlertStoreImpl) ForEach

func (alertStore *AlertStoreImpl) ForEach(cb func(alert Alert)) error

func (*AlertStoreImpl) Put

func (alertStore *AlertStoreImpl) Put(alert Alert) error

Jump to

Keyboard shortcuts

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