notification

package
v2.7.4 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckLevel

type CheckLevel int

CheckLevel is the enum value of status levels.

const (
	Unknown CheckLevel = iota
	Ok
	Info
	Warn
	Critical
	Any
)

consts of CheckStatusLevel

func ParseCheckLevel

func ParseCheckLevel(s string) CheckLevel

ParseCheckLevel will parse the string to checkLevel

func (CheckLevel) MarshalJSON

func (cl CheckLevel) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaller.

func (CheckLevel) String

func (cl CheckLevel) String() string

String returns the string value, invalid CheckLevel will return Unknown.

func (*CheckLevel) UnmarshalJSON

func (cl *CheckLevel) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaller.

type Duration

type Duration ast.DurationLiteral

Duration is a custom type used for generating flux compatible durations.

func FromTimeDuration

func FromTimeDuration(d time.Duration) (Duration, error)

FromTimeDuration converts a time.Duration to a notification.Duration type.

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

MarshalJSON turns a Duration into a JSON-ified string.

func (Duration) TimeDuration

func (d Duration) TimeDuration() time.Duration

TimeDuration convert notification.Duration to time.Duration.

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

UnmarshalJSON turns a flux duration literal into a Duration.

type StatusRule

type StatusRule struct {
	CurrentLevel  CheckLevel  `json:"currentLevel"`
	PreviousLevel *CheckLevel `json:"previousLevel"`
}

StatusRule includes parameters of status rules.

type TagRule

type TagRule influxdb.TagRule

TagRule is the struct of tag rule.

func (TagRule) GenerateFluxAST

func (tr TagRule) GenerateFluxAST() ast.Expression

GenerateFluxAST generates the AST expression for a tag rule.

func (TagRule) Valid

func (tr TagRule) Valid() error

Valid returns error for invalid operators.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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