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 ¶
FromTimeDuration converts a time.Duration to a notification.Duration type.
func (Duration) MarshalJSON ¶
MarshalJSON turns a Duration into a JSON-ified string.
func (Duration) TimeDuration ¶
TimeDuration convert notification.Duration to time.Duration.
func (*Duration) UnmarshalJSON ¶
UnmarshalJSON turns a flux duration literal into a Duration.
type StatusRule ¶
type StatusRule struct { CurrentLevel CheckLevel `json:"currentLevel"` PreviousLevel *CheckLevel `json:"previousLevel"` }
StatusRule includes parametes 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.