threshold

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Operators = []string{">", ">=", "==", "<", "<=", "!="}

Functions

This section is empty.

Types

type ThresFuncExpr

type ThresFuncExpr string // 運算式

func (ThresFuncExpr) Equal

func (tfExpr ThresFuncExpr) Equal(thresFuncArgs map[string]interface{}) (bool, error)

Equal() 會將運算表達式與門檻值進行比較

func (ThresFuncExpr) Thresholds

func (tfExpr ThresFuncExpr) Thresholds() (Thresholds, error)

Thresholds() 會將運算表達式轉換成 Thresholds

type Threshold

type Threshold struct {
	KeyName  string `json:"KeyName" validate:"required"`  // 指定的門檻意義
	Operator string `json:"Operator" validate:"required"` // 運算符號
	Value    *int64 `json:"Value" validate:"required"`    // 門檻值
}

type Thresholds

type Thresholds []Threshold

func (Thresholds) ThresFuncExpr

func (thres Thresholds) ThresFuncExpr() (ThresFuncExpr, error)

ThresFunc() 會將 Thresholds 轉換成運算表達式

Jump to

Keyboard shortcuts

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