condition

package
v0.0.0-...-7373d6a Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConditionTypeSeries = iota
	ConditionTypeDataFrame
)
View Source
const (
	ComparatorGT    = ">"
	ComparatorLT    = "<"
	ComparatorGTE   = ">="
	ComparatorEq    = "="
	ComparatorLTE   = "<="
	ComparatorIn    = "in"
	ComparatorIsNan = "is_nan"
)

Variables

This section is empty.

Functions

func NewAST

func NewAST() *condAST

func NewExprStack

func NewExprStack() *exprStack

Types

type BinaryExprAST

type BinaryExprAST struct {
	Op string
	Lhs,
	Rhs ExprAST
}

type CompItem

type CompItem struct {
	Comparator string
	Column     string
	Value      interface{}
}

type CondValue

type CondValue struct {
	Cond     *Condition
	CompItem *CompItem
	IsNot    bool
}

func (*CondValue) CompareBool

func (condVal *CondValue) CompareBool(leftVal bool) (compareResult bool, err error)

func (*CondValue) CompareFloat64

func (condVal *CondValue) CompareFloat64(leftVal float64) (compareResult bool, err error)

func (*CondValue) CompareInt

func (condVal *CondValue) CompareInt(leftVal int64) (compareResult bool, err error)

func (*CondValue) String

func (condVal *CondValue) String() string

type Condition

type Condition struct {
	// contains filtered or unexported fields
}

func NewCondition

func NewCondition(condType int) *Condition

func (*Condition) And

func (cond *Condition) And(comparator string, value interface{}, columns ...string) *Condition

func (*Condition) AndCond

func (cond *Condition) AndCond(otherCond *Condition) *Condition

func (*Condition) Or

func (cond *Condition) Or(comparator string, value interface{}, columns ...string) *Condition

func (*Condition) OrCond

func (cond *Condition) OrCond(otherCond *Condition) *Condition

func (*Condition) Prepare

func (cond *Condition) Prepare() ExprAST

func (*Condition) String

func (cond *Condition) String() string

type ExprAST

type ExprAST interface {
	// contains filtered or unexported methods
}

type ValueExprAST

type ValueExprAST struct {
	Value *CondValue
}

Jump to

Keyboard shortcuts

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