fx

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterNewBinOpExpCreator

func RegisterNewBinOpExpCreator(op Operator, creator BinOpExpCreator)

Types

type BinOpExp

type BinOpExp struct {
	Op Operator
	Lh Expression
	Rh Expression
}

type BinOpExpCreator

type BinOpExpCreator func(lh *Value, rh *Value) Expression

type EqualExp

type EqualExp struct {
	BinOpExp
}

func (EqualExp) Calc

func (e EqualExp) Calc() *Value

type Expression

type Expression interface {
	Calc() *Value
}

func NewBinOpExp

func NewBinOpExp(op Operator, lh, rh *Value) (Expression, *util.Result)

func NewEqualExp

func NewEqualExp(lh, rh *Value) Expression

func NewGreaterEqExp

func NewGreaterEqExp(lh, rh *Value) Expression

func NewGreatorExp

func NewGreatorExp(lh, rh *Value) Expression

func NewIncludeExp

func NewIncludeExp(lh, rh *Value) Expression

func NewLessEqExp

func NewLessEqExp(lh, rh *Value) Expression

func NewLessExp

func NewLessExp(lh, rh *Value) Expression

func NewNotEqExp

func NewNotEqExp(lh, rh *Value) Expression

type GreaterEqExp

type GreaterEqExp struct {
	BinOpExp
}

func (GreaterEqExp) Calc

func (e GreaterEqExp) Calc() *Value

type GreatorExp

type GreatorExp struct {
	BinOpExp
}

func (GreatorExp) Calc

func (e GreatorExp) Calc() *Value

type IncludeExp

type IncludeExp struct {
	BinOpExp
}

func (IncludeExp) Calc

func (e IncludeExp) Calc() *Value

type LessEqExp

type LessEqExp struct {
	BinOpExp
}

func (LessEqExp) Calc

func (e LessEqExp) Calc() *Value

type LessExp

type LessExp struct {
	BinOpExp
}

func (LessExp) Calc

func (e LessExp) Calc() *Value

type NotEqExp

type NotEqExp struct {
	BinOpExp
}

func (NotEqExp) Calc

func (e NotEqExp) Calc() *Value

type Operator

type Operator string
const (
	//Unknown
	UnkownOp Operator = ""

	//Relation Ops
	LessOp      Operator = "<"
	GreaterOp   Operator = ">"
	EqualOp     Operator = "=="
	LessEqOp    Operator = "<="
	GreaterEqOp Operator = ">="
	NotEqOp     Operator = "!="

	//Text Ops
	IncludeOp Operator = "~="
)

func ParseOperator

func ParseOperator(str string) (Operator, *util.Result)

type Value

type Value struct {
	Text      *string      `json:"text,omitempty" yaml:"text,omitempty"`
	IsNumeric bool         `json:"is_numeric" yaml:"is_numeric"`
	Number    *float64     `json:"number,omitempty" yaml:"number,omitempty"`
	Error     *util.Result `json:"error,omitempty" yaml:"error,omitempty"`
}

func Bool

func Bool(b bool) *Value

func Dual

func Dual(str string) *Value

func Error

func Error(err *util.Result) *Value

func False

func False() *Value

func Nil

func Nil() *Value

func Number

func Number(n float64) *Value

func Text

func Text(s string) *Value

func True

func True() *Value

func (*Value) And

func (lh *Value) And(rh *Value) *Value

func (*Value) Calc

func (v *Value) Calc() *Value

func (*Value) Equal

func (lh *Value) Equal(rh *Value) *Value

func (*Value) False

func (v *Value) False() bool

func (*Value) HasError

func (v *Value) HasError() bool

func (*Value) IsBool

func (v *Value) IsBool() bool

func (*Value) IsNil

func (v *Value) IsNil() bool

func (*Value) Less

func (lh *Value) Less(rh *Value) *Value

func (*Value) Not

func (lh *Value) Not() *Value

func (*Value) Or

func (lh *Value) Or(rh *Value) *Value

func (*Value) SetError

func (v *Value) SetError(err *util.Result)

func (*Value) SetFalse

func (v *Value) SetFalse() *Value

func (*Value) SetNum

func (v *Value) SetNum(n float64) *Value

func (*Value) SetText

func (v *Value) SetText(t string) *Value

func (*Value) SetTrue

func (v *Value) SetTrue() *Value

func (*Value) SetValue

func (v *Value) SetValue(s string) *Value

func (*Value) String added in v0.5.1

func (v *Value) String() string

func (*Value) True

func (v *Value) True() bool

Jump to

Keyboard shortcuts

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