expr

package
v0.5.9 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: BSD-3-Clause Imports: 7 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	OR             = "||"
	AND            = "&&"
	EQ             = "=="
	NOT_EQ         = "!="
	GT             = ">"
	LT             = "<"
	GTE            = ">="
	LTE            = "<="
	ADDITION       = "+"
	SUBTRACTION    = "-"
	MULTIPLICATION = "*"
	DIVIDE         = "/"
	MODE           = "%"
)

Variables

This section is empty.

Functions

func ConvertToSameType added in v0.5.5

func ConvertToSameType(left interface{}, right interface{}) (interface{}, interface{}, error)

Types

type Expr

type Expr interface {
	EvalWithScope(inputScope data.Scope, resolver data.Resolver) (interface{}, error)
	Eval() (interface{}, error)
	EvalWithData(value interface{}, inputScope data.Scope, resolver data.Resolver) (interface{}, error)
}

type Expression

type Expression struct {
	Left     Expr   `json:"left"`
	Operator string `json:"operator"`
	Right    Expr   `json:"right"`
	Value    Expr   `json:"value"`
}

func NewExpression

func NewExpression() *Expression

func (*Expression) Eval

func (f *Expression) Eval() (interface{}, error)

func (*Expression) EvalWithData

func (f *Expression) EvalWithData(data interface{}, inputScope data.Scope, resolver data.Resolver) (interface{}, error)

func (*Expression) EvalWithScope

func (f *Expression) EvalWithScope(inputScope data.Scope, resolver data.Resolver) (interface{}, error)

func (*Expression) IsNil

func (e *Expression) IsNil() bool

func (*Expression) String

func (e *Expression) String() string

type LiteralExpr added in v0.5.8

type LiteralExpr struct {
	V interface{}
}

func NewLiteralExpr added in v0.5.8

func NewLiteralExpr(v interface{}) *LiteralExpr

func (*LiteralExpr) Eval added in v0.5.8

func (iffl *LiteralExpr) Eval() (interface{}, error)

func (*LiteralExpr) EvalWithData added in v0.5.8

func (iffl *LiteralExpr) EvalWithData(value interface{}, inputScope data.Scope, resolver data.Resolver) (interface{}, error)

func (*LiteralExpr) EvalWithScope added in v0.5.8

func (iffl *LiteralExpr) EvalWithScope(inputScope data.Scope, resolver data.Resolver) (interface{}, error)

type TernaryExpression added in v0.5.8

type TernaryExpression struct {
	First  Expr
	Second Expr
	Third  Expr
}

func (*TernaryExpression) Eval added in v0.5.8

func (t *TernaryExpression) Eval() (interface{}, error)

func (*TernaryExpression) EvalWithData added in v0.5.8

func (t *TernaryExpression) EvalWithData(value interface{}, inputScope data.Scope, resolver data.Resolver) (interface{}, error)

func (*TernaryExpression) EvalWithScope added in v0.5.8

func (t *TernaryExpression) EvalWithScope(inputScope data.Scope, resolver data.Resolver) (interface{}, error)

func (*TernaryExpression) HandleParameter added in v0.5.8

func (t *TernaryExpression) HandleParameter(param interface{}, value interface{}, inputScope data.Scope, resolver data.Resolver) (interface{}, error)

Jump to

Keyboard shortcuts

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