validators

package
v0.3.10-0-alpha2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrMissingParameterThreshold = errors.Error("Condition is missing the threshold parameter")
	ErrMissingParameterType      = errors.Error("Condition is missing the type parameter")
	ErrInvalidEvaluatorType      = errors.Error("Invalid condition evaluator type")
	ErrAlertConditionUnknown     = errors.Error("Unknown alert condition")
	ErrAlertConditionEmpty       = errors.Error("Alert is missing conditions")
)

Variables

View Source
var (
	EvaluatorDefaultTypes = []string{"gt", "lt", "eq"}
	EvaluatorRangedTypes  = []string{"within_range", "outside_range"}

	CommonAlertType = []string{
		monitor.CommonAlertNomalAlertType,
		monitor.CommonAlertSystemAlertType,
		monitor.CommonAlertServiceAlertType,
	}
	CommonAlertReducerFieldOpts = []string{"/"}
	CommonAlertNotifyTypes      = []string{"email", "mobile", "dingtalk", "webconsole", "feishu"}

	ConditionTypes = []string{"query", "nodata_query"}
)

Functions

func HumanThresholdType

func HumanThresholdType(typ string) string

HumanThresholdType converts a threshold "type" string to a string that matches the UI so errors are less confusing.

func ValidateAlertCondition

func ValidateAlertCondition(input monitor.AlertCondition) error

func ValidateAlertConditionEvaluator

func ValidateAlertConditionEvaluator(input monitor.Condition) error

func ValidateAlertConditionQuery

func ValidateAlertConditionQuery(input monitor.AlertQuery) error

func ValidateAlertConditionRangedEvaluator

func ValidateAlertConditionRangedEvaluator(input monitor.Condition) error

func ValidateAlertConditionReducer

func ValidateAlertConditionReducer(input monitor.Condition) error

func ValidateAlertConditionThresholdEvaluator

func ValidateAlertConditionThresholdEvaluator(input monitor.Condition) error

func ValidateAlertConditionType

func ValidateAlertConditionType(typ string) error

func ValidateAlertCreateInput

func ValidateAlertCreateInput(input monitor.AlertCreateInput) error

func ValidateAlertQueryModel

func ValidateAlertQueryModel(input monitor.MetricQuery) error

func ValidateFromAndToValue

func ValidateFromAndToValue(input monitor.AlertQuery) error

func ValidateFromValue

func ValidateFromValue(from string) error

func ValidateSelectOfMetricQuery

func ValidateSelectOfMetricQuery(input monitor.AlertQuery) error

func ValidateToValue

func ValidateToValue(to string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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