alarm

package
v1.4.8 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Activated model.Status = "ACTIVATED"
	Cleared   model.Status = "CLEARED"
)
View Source
const (
	IDBackendConnectionRefuse model.ID = "BackendConnectionRefuse"
	IDInternalError           model.ID = "InternalError"
)
View Source
const (
	Subject = "__ALARM_SUBJECT__"
	Group   = "__ALARM_GROUP__"
)
View Source
const (
	FieldAdditionalContext = "detail"
)

Variables

View Source
var ALARM = notify.RegisterType("ALARM", 0)

Functions

func AdditionalContext

func AdditionalContext(format string, args ...interface{}) model.Field

func Clear

func Clear(id model.ID) error

func ClearAll

func ClearAll()

func FieldBool

func FieldBool(key string, v bool) model.Field

func FieldFloat64

func FieldFloat64(key string, v float64) model.Field

func FieldInt

func FieldInt(key string, v int) model.Field

func FieldInt64

func FieldInt64(key string, v int64) model.Field

func FieldString

func FieldString(key string, v string) model.Field

func ListAll

func ListAll() []*model.AlarmEvent

func Raise

func Raise(id model.ID, fields ...model.Field) error

Types

type Service

type Service struct {
	nf.Subscriber
	// contains filtered or unexported fields
}

func Center

func Center() *Service

func NewAlarmService

func NewAlarmService() *Service

func (*Service) Clear

func (ac *Service) Clear(id model.ID) error

func (*Service) ClearAll

func (ac *Service) ClearAll()

func (*Service) ListAll

func (ac *Service) ListAll() (ls []*model.AlarmEvent)

func (*Service) OnMessage

func (ac *Service) OnMessage(evt nf.Event)

func (*Service) Raise

func (ac *Service) Raise(id model.ID, fields ...model.Field) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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