expr

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: Apache-2.0 Imports: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Equal                   = OperatorExpr("==")
	NotEqual                = OperatorExpr("~=")
	RegularMatch            = OperatorExpr("~~")
	InsensitiveRegularMatch = OperatorExpr("~*")
	Not                     = OperatorExpr("!")
	Has                     = OperatorExpr("has")
	In                      = OperatorExpr("in")
	GreaterThan             = OperatorExpr(">")
	LessThan                = OperatorExpr("<")
	IPMatch                 = OperatorExpr("ipmatch")
	AND                     = OperatorExpr("AND")
	OR                      = OperatorExpr("OR")
	NOTANT                  = OperatorExpr("!AND")
	NOTOR                   = OperatorExpr("!OR")
)

Functions

This section is empty.

Types

type Expr

type Expr struct {
	Type       Type `json:"-"`
	NumberVal  float64
	StringVal  string
	BooleanVal bool
	ArrayVal   []Expr
}

func And

func And(exprArray ...Expr) Expr

func ArrayExpr

func ArrayExpr(expr ...Expr) Expr

func BooleanExpr

func BooleanExpr(b bool) Expr

func ExprArrayFromStrings

func ExprArrayFromStrings(stringArray []string) []Expr

func ExprFromStrings

func ExprFromStrings(stringArray []string) Expr

func NewExpr

func NewExpr() Expr

func NotAnd

func NotAnd(exprArray ...Expr) Expr

func NotOr

func NotOr(exprArray ...Expr) Expr

func NumberExpr

func NumberExpr(number float64) Expr

func OperatorExpr

func OperatorExpr(o string) Expr

func Or

func Or(exprArray ...Expr) Expr

func StringExpr

func StringExpr(str string) Expr

func (Expr) AppendExpr

func (e Expr) AppendExpr(expr ...Expr) Expr

AppendExpr function appends element to the end of this Expr ArrayVal

func (Expr) AppendString

func (e Expr) AppendString(str string) Expr

AppendString function is a simple way to append string variable.

func (Expr) AppendStrings

func (e Expr) AppendStrings(strs ...string)

func (Expr) CreateArrayExpr

func (e Expr) CreateArrayExpr(exprArray ...Expr) Expr

CreateArrayExpr function create a new array type Expr contains this expr and input exprs

func (*Expr) DeepCopy added in v0.1.1

func (e *Expr) DeepCopy() *Expr

func (*Expr) DeepCopyInto added in v0.1.1

func (e *Expr) DeepCopyInto(out *Expr)

func (Expr) Equals

func (e Expr) Equals(expr Expr) Expr

func (Expr) GreaterThan

func (e Expr) GreaterThan(expr Expr) Expr

func (Expr) Has

func (e Expr) Has(expr Expr) Expr

func (Expr) IPMatch

func (e Expr) IPMatch(expr Expr) Expr

func (Expr) In

func (e Expr) In(expr Expr) Expr

func (Expr) InsensitiveRegularMatch

func (e Expr) InsensitiveRegularMatch(expr Expr) Expr

func (Expr) LessThan

func (e Expr) LessThan(expr Expr) Expr

func (*Expr) MarshalJSON

func (expr *Expr) MarshalJSON() ([]byte, error)

func (Expr) Not

func (e Expr) Not() Expr

func (Expr) NotEquals

func (e Expr) NotEquals(expr Expr) Expr

func (Expr) NotIn

func (e Expr) NotIn(expr Expr) Expr

func (Expr) RegularMatch

func (e Expr) RegularMatch(expr Expr) Expr

func (*Expr) StringArrayExpr

func (e *Expr) StringArrayExpr(strs ...string) Expr

StringArrayExpr function create a new array type Expr by string slice.

func (Expr) ToArray

func (e Expr) ToArray() []Expr

func (*Expr) UnmarshalJSON

func (expr *Expr) UnmarshalJSON(buf []byte) error

type Type

type Type int
const (
	TYPE_STRING Type = iota
	TYPE_NUMBER
	TYPE_BOOLEAN
	TYPE_ARRAY
	TYPE_OPERATOR
)

Jump to

Keyboard shortcuts

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