filter

package
v0.0.0-...-b9ce5d9 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RelationalOperator_GTE      = ">="
	RelationalOperator_LTE      = "<="
	RelationalOperator_EQ       = "=="
	RelationalOperator_TSEQ     = "==="
	RelationalOperator_NE       = "!="
	RelationalOperator_TSNE     = "!=="
	RelationalOperator_LT       = "<"
	RelationalOperator_GT       = ">"
	RelationalOperator_REGEX    = "=~"
	RelationalOperator_NIN      = "NIN"
	RelationalOperator_IN       = "IN"
	RelationalOperator_CONTAINS = "CONTAINS"
	RelationalOperator_ALL      = "ALL"
	RelationalOperator_SIZE     = "SIZE"
	RelationalOperator_EXISTS   = "EXISTS"
	RelationalOperator_TYPE     = "TYPE"
	RelationalOperator_MATCHES  = "MATCHES"
	RelationalOperator_EMPTY    = "EMPTY"
	RelationalOperator_SUBSETOF = "SUBSETOF"
	RelationalOperator_ANYOF    = "ANYOF"
	RelationalOperator_NONEOF   = "NONEOF"
)

RelationalOperator

View Source
const (
	LogicalOperator_AND = "&&"
	LogicalOperator_NOT = "!"
	LogicalOperator_OR  = "||"
)

LogicalOperator

View Source
const (
	DOC_CONTEXT          = '$'
	EVAL_CONTEXT         = '@'
	OPEN_SQUARE_BRACKET  = '['
	CLOSE_SQUARE_BRACKET = ']'
	OPEN_PARENTHESIS     = '('
	CLOSE_PARENTHESIS    = ')'
	OPEN_OBJECT          = '{'
	CLOSE_OBJECT         = '}'
	OPEN_ARRAY           = '['
	CLOSE_ARRAY          = ']'

	SINGLE_QUOTE = '\''
	DOUBLE_QUOTE = '"'

	SPACE  = ' '
	PERIOD = '.'

	AND = '&'
	OR  = '|'

	MINUS       = '-'
	LT          = '<'
	GT          = '>'
	EQ          = '='
	TILDE       = '~'
	TRUE        = 't'
	FALSE       = 'f'
	NULL        = 'n'
	NOT         = '!'
	PATTERN     = '/'
	IGNORE_CASE = 'i'
)
View Source
const (
	PATH_DOC_CONTEXT  = '$'
	PATH_EVAL_CONTEXT = '@'

	PATH_OPEN_SQUARE_BRACKET  = '['
	PATH_CLOSE_SQUARE_BRACKET = ']'
	PATH_OPEN_PARENTHESIS     = '('
	PATH_CLOSE_PARENTHESIS    = ')'
	PATH_OPEN_BRACE           = '{'
	PATH_CLOSE_BRACE          = '}'

	WILDCARD          = '*'
	PATH_PERIOD       = '.'
	PATH_SPACE        = ' '
	TAB               = '\t'
	CR                = '\r'
	LF                = '\n'
	BEGIN_FILTER      = '?'
	COMMA             = ','
	SPLIT             = ':'
	PATH_MINUS        = '-'
	PATH_SINGLE_QUOTE = '\''
	PATH_DOUBLE_QUOTE = '"'
)

Variables

View Source
var FALSE_NODE = CreateBooleanNode(false)
View Source
var NULL_NODE = CreateNullNode()
View Source
var UNDEFINED_NODE = &UndefinedNode{}

Functions

func OffsetDateTimeCompare

func OffsetDateTimeCompare(this *OffsetDateTime, that *OffsetDateTime) int

func PathCompile

func PathCompile(pathString string, filters ...common.Predicate) (common.Path, error)

func PathCompileByStringAndPredicateSlice

func PathCompileByStringAndPredicateSlice(pathString string, filters []common.Predicate) (common.Path, error)

Types

type BooleanNode

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

BooleanNode -----------

func CreateBooleanNode

func CreateBooleanNode(value bool) *BooleanNode

func CreateBooleanNodeByString

func CreateBooleanNodeByString(str string) *BooleanNode

func (*BooleanNode) AsBooleanNode

func (n *BooleanNode) AsBooleanNode() (*BooleanNode, error)

func (BooleanNode) AsClassNode

func (_ BooleanNode) AsClassNode() (*ClassNode, error)

func (BooleanNode) AsJsonNode

func (_ BooleanNode) AsJsonNode() (*JsonNode, error)

func (BooleanNode) AsNullNode

func (_ BooleanNode) AsNullNode() (*NullNode, error)

func (BooleanNode) AsNumberNode

func (_ BooleanNode) AsNumberNode() (*NumberNode, error)

func (BooleanNode) AsOffsetDateTimeNode

func (_ BooleanNode) AsOffsetDateTimeNode() (*OffsetDateTimeNode, error)

func (BooleanNode) AsPathNode

func (_ BooleanNode) AsPathNode() (*PathNode, error)

func (BooleanNode) AsPatternNode

func (_ BooleanNode) AsPatternNode() (*PatternNode, error)

func (BooleanNode) AsPredicateNode

func (_ BooleanNode) AsPredicateNode() (*PredicateNode, error)

func (BooleanNode) AsStringNode

func (_ BooleanNode) AsStringNode() (*StringNode, error)

func (BooleanNode) AsUndefinedNode

func (_ BooleanNode) AsUndefinedNode() (*UndefinedNode, error)

func (BooleanNode) AsValueListNode

func (_ BooleanNode) AsValueListNode() (*ValueListNode, error)

func (*BooleanNode) Equals

func (n *BooleanNode) Equals(o interface{}) bool

func (*BooleanNode) GetBoolean

func (n *BooleanNode) GetBoolean() bool

func (*BooleanNode) IsBooleanNode

func (*BooleanNode) IsBooleanNode() bool

func (BooleanNode) IsClassNode

func (n BooleanNode) IsClassNode() bool

func (BooleanNode) IsJsonNode

func (n BooleanNode) IsJsonNode() bool

func (BooleanNode) IsNullNode

func (n BooleanNode) IsNullNode() bool

func (BooleanNode) IsNumberNode

func (n BooleanNode) IsNumberNode() bool

func (BooleanNode) IsOffsetDateTimeNode

func (n BooleanNode) IsOffsetDateTimeNode() bool

func (BooleanNode) IsPathNode

func (n BooleanNode) IsPathNode() bool

func (BooleanNode) IsPatternNode

func (n BooleanNode) IsPatternNode() bool

func (BooleanNode) IsPredicateNode

func (n BooleanNode) IsPredicateNode() bool

func (BooleanNode) IsStringNode

func (n BooleanNode) IsStringNode() bool

func (BooleanNode) IsUndefinedNode

func (n BooleanNode) IsUndefinedNode() bool

func (BooleanNode) IsValueListNode

func (n BooleanNode) IsValueListNode() bool

func (*BooleanNode) String

func (n *BooleanNode) String() string

func (*BooleanNode) TypeOf

type ClassNode

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

ClassNode -----------

func (ClassNode) AsBooleanNode

func (_ ClassNode) AsBooleanNode() (*BooleanNode, error)

func (ClassNode) AsJsonNode

func (_ ClassNode) AsJsonNode() (*JsonNode, error)

func (ClassNode) AsNullNode

func (_ ClassNode) AsNullNode() (*NullNode, error)

func (ClassNode) AsNumberNode

func (_ ClassNode) AsNumberNode() (*NumberNode, error)

func (ClassNode) AsOffsetDateTimeNode

func (_ ClassNode) AsOffsetDateTimeNode() (*OffsetDateTimeNode, error)

func (ClassNode) AsPathNode

func (_ ClassNode) AsPathNode() (*PathNode, error)

func (ClassNode) AsPatternNode

func (_ ClassNode) AsPatternNode() (*PatternNode, error)

func (ClassNode) AsPredicateNode

func (_ ClassNode) AsPredicateNode() (*PredicateNode, error)

func (ClassNode) AsStringNode

func (_ ClassNode) AsStringNode() (*StringNode, error)

func (ClassNode) AsUndefinedNode

func (_ ClassNode) AsUndefinedNode() (*UndefinedNode, error)

func (ClassNode) AsValueListNode

func (_ ClassNode) AsValueListNode() (*ValueListNode, error)

func (ClassNode) IsBooleanNode

func (n ClassNode) IsBooleanNode() bool

func (ClassNode) IsJsonNode

func (n ClassNode) IsJsonNode() bool

func (ClassNode) IsNullNode

func (n ClassNode) IsNullNode() bool

func (ClassNode) IsNumberNode

func (n ClassNode) IsNumberNode() bool

func (ClassNode) IsOffsetDateTimeNode

func (n ClassNode) IsOffsetDateTimeNode() bool

func (ClassNode) IsPathNode

func (n ClassNode) IsPathNode() bool

func (ClassNode) IsPatternNode

func (n ClassNode) IsPatternNode() bool

func (ClassNode) IsPredicateNode

func (n ClassNode) IsPredicateNode() bool

func (ClassNode) IsStringNode

func (n ClassNode) IsStringNode() bool

func (ClassNode) IsUndefinedNode

func (n ClassNode) IsUndefinedNode() bool

func (ClassNode) IsValueListNode

func (n ClassNode) IsValueListNode() bool

type CompiledFilter

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

func Compile

func Compile(filterString string) (*CompiledFilter, error)

func (*CompiledFilter) Apply

func (cf *CompiledFilter) Apply(ctx common.PredicateContext) (bool, error)

func (*CompiledFilter) String

func (cf *CompiledFilter) String() string

type Compiler

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

func CreateFilterCompiler

func CreateFilterCompiler(filterString string) (*Compiler, error)

func (*Compiler) Compile

func (c *Compiler) Compile() (common.Predicate, error)

type Evaluator

type Evaluator interface {
	Evaluate(left ValueNode, right ValueNode, ctx common.PredicateContext) (bool, error)
}

func CreateEvaluator

func CreateEvaluator(operator string) Evaluator

type ExpressionNode

type ExpressionNode interface {
	common.Predicate
	ExpressionNodeLabel()
}

type JsonNode

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

JsonNode --------

func CreateJsonNodeByObject

func CreateJsonNodeByObject(json interface{}) *JsonNode

func CreateJsonNodeByString

func CreateJsonNodeByString(json string) *JsonNode

func (JsonNode) AsBooleanNode

func (_ JsonNode) AsBooleanNode() (*BooleanNode, error)

func (JsonNode) AsClassNode

func (_ JsonNode) AsClassNode() (*ClassNode, error)

func (*JsonNode) AsJsonNode

func (n *JsonNode) AsJsonNode() (*JsonNode, error)

func (JsonNode) AsNullNode

func (_ JsonNode) AsNullNode() (*NullNode, error)

func (JsonNode) AsNumberNode

func (_ JsonNode) AsNumberNode() (*NumberNode, error)

func (JsonNode) AsOffsetDateTimeNode

func (_ JsonNode) AsOffsetDateTimeNode() (*OffsetDateTimeNode, error)

func (JsonNode) AsPathNode

func (_ JsonNode) AsPathNode() (*PathNode, error)

func (JsonNode) AsPatternNode

func (_ JsonNode) AsPatternNode() (*PatternNode, error)

func (JsonNode) AsPredicateNode

func (_ JsonNode) AsPredicateNode() (*PredicateNode, error)

func (JsonNode) AsStringNode

func (_ JsonNode) AsStringNode() (*StringNode, error)

func (JsonNode) AsUndefinedNode

func (_ JsonNode) AsUndefinedNode() (*UndefinedNode, error)

func (JsonNode) AsValueListNode

func (_ JsonNode) AsValueListNode() (*ValueListNode, error)

func (*JsonNode) AsValueListNodeByPredicateContext

func (n *JsonNode) AsValueListNodeByPredicateContext(ctx common.PredicateContext) (ValueNode, error)

func (*JsonNode) Equals

func (n *JsonNode) Equals(o interface{}) bool

func (*JsonNode) EqualsByPredicateContext

func (n *JsonNode) EqualsByPredicateContext(jsonNode *JsonNode, ctx common.PredicateContext) (bool, error)

func (*JsonNode) GetJson

func (n *JsonNode) GetJson() interface{}

func (*JsonNode) IsArray

func (n *JsonNode) IsArray(ctx common.PredicateContext) bool

func (JsonNode) IsBooleanNode

func (n JsonNode) IsBooleanNode() bool

func (JsonNode) IsClassNode

func (n JsonNode) IsClassNode() bool

func (*JsonNode) IsEmpty

func (n *JsonNode) IsEmpty(ctx common.PredicateContext) (bool, error)

func (*JsonNode) IsJsonNode

func (*JsonNode) IsJsonNode() bool

func (*JsonNode) IsMap

func (n *JsonNode) IsMap(ctx common.PredicateContext) bool

func (JsonNode) IsNullNode

func (n JsonNode) IsNullNode() bool

func (JsonNode) IsNumberNode

func (n JsonNode) IsNumberNode() bool

func (JsonNode) IsOffsetDateTimeNode

func (n JsonNode) IsOffsetDateTimeNode() bool

func (*JsonNode) IsParsed

func (n *JsonNode) IsParsed() bool

func (JsonNode) IsPathNode

func (n JsonNode) IsPathNode() bool

func (JsonNode) IsPatternNode

func (n JsonNode) IsPatternNode() bool

func (JsonNode) IsPredicateNode

func (n JsonNode) IsPredicateNode() bool

func (JsonNode) IsStringNode

func (n JsonNode) IsStringNode() bool

func (JsonNode) IsUndefinedNode

func (n JsonNode) IsUndefinedNode() bool

func (JsonNode) IsValueListNode

func (n JsonNode) IsValueListNode() bool

func (*JsonNode) Length

func (n *JsonNode) Length(ctx common.PredicateContext) int

func (*JsonNode) Parse

func (n *JsonNode) Parse(ctx common.PredicateContext) (interface{}, error)

func (*JsonNode) String

func (n *JsonNode) String() string

func (*JsonNode) TypeOf

func (n *JsonNode) TypeOf(ctx common.PredicateContext) reflect.Kind

type LogicalExpressionNode

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

LogicalExpressionNode ----

func CreateLogicalAnd

func CreateLogicalAnd(left ExpressionNode, right ExpressionNode) *LogicalExpressionNode

func CreateLogicalAndByList

func CreateLogicalAndByList(operands []ExpressionNode) *LogicalExpressionNode

func CreateLogicalNot

func CreateLogicalNot(op ExpressionNode) *LogicalExpressionNode

func CreateLogicalOr

func CreateLogicalOr(left ExpressionNode, right ExpressionNode) *LogicalExpressionNode

func CreateLogicalOrByList

func CreateLogicalOrByList(operands []ExpressionNode) *LogicalExpressionNode

func (*LogicalExpressionNode) And

func (*LogicalExpressionNode) Append

func (*LogicalExpressionNode) Apply

func (*LogicalExpressionNode) ExpressionNodeLabel

func (e *LogicalExpressionNode) ExpressionNodeLabel()

func (*LogicalExpressionNode) GetOperator

func (e *LogicalExpressionNode) GetOperator() string

func (*LogicalExpressionNode) Or

func (*LogicalExpressionNode) String

func (e *LogicalExpressionNode) String() string

type NullNode

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

NullNode -----------

func CreateNullNode

func CreateNullNode() *NullNode

func (NullNode) AsBooleanNode

func (_ NullNode) AsBooleanNode() (*BooleanNode, error)

func (NullNode) AsClassNode

func (_ NullNode) AsClassNode() (*ClassNode, error)

func (NullNode) AsJsonNode

func (_ NullNode) AsJsonNode() (*JsonNode, error)

func (*NullNode) AsNullNode

func (n *NullNode) AsNullNode() (*NullNode, error)

func (NullNode) AsNumberNode

func (_ NullNode) AsNumberNode() (*NumberNode, error)

func (NullNode) AsOffsetDateTimeNode

func (_ NullNode) AsOffsetDateTimeNode() (*OffsetDateTimeNode, error)

func (NullNode) AsPathNode

func (_ NullNode) AsPathNode() (*PathNode, error)

func (NullNode) AsPatternNode

func (_ NullNode) AsPatternNode() (*PatternNode, error)

func (NullNode) AsPredicateNode

func (_ NullNode) AsPredicateNode() (*PredicateNode, error)

func (NullNode) AsStringNode

func (_ NullNode) AsStringNode() (*StringNode, error)

func (NullNode) AsUndefinedNode

func (_ NullNode) AsUndefinedNode() (*UndefinedNode, error)

func (NullNode) AsValueListNode

func (_ NullNode) AsValueListNode() (*ValueListNode, error)

func (*NullNode) Equals

func (n *NullNode) Equals(o interface{}) bool

func (NullNode) IsBooleanNode

func (n NullNode) IsBooleanNode() bool

func (NullNode) IsClassNode

func (n NullNode) IsClassNode() bool

func (NullNode) IsJsonNode

func (n NullNode) IsJsonNode() bool

func (*NullNode) IsNullNode

func (n *NullNode) IsNullNode() bool

func (NullNode) IsNumberNode

func (n NullNode) IsNumberNode() bool

func (NullNode) IsOffsetDateTimeNode

func (n NullNode) IsOffsetDateTimeNode() bool

func (NullNode) IsPathNode

func (n NullNode) IsPathNode() bool

func (NullNode) IsPatternNode

func (n NullNode) IsPatternNode() bool

func (NullNode) IsPredicateNode

func (n NullNode) IsPredicateNode() bool

func (NullNode) IsStringNode

func (n NullNode) IsStringNode() bool

func (NullNode) IsUndefinedNode

func (n NullNode) IsUndefinedNode() bool

func (NullNode) IsValueListNode

func (n NullNode) IsValueListNode() bool

func (*NullNode) String

func (n *NullNode) String() string

func (*NullNode) TypeOf

func (n *NullNode) TypeOf(ctx common.PredicateContext) reflect.Kind

type NumberNode

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

NumberNode -----------

func CreateNumberNode

func CreateNumberNode(decimal2 *decimal.Decimal) *NumberNode

func CreateNumberNodeByString

func CreateNumberNodeByString(str string) (*NumberNode, error)

func (NumberNode) AsBooleanNode

func (_ NumberNode) AsBooleanNode() (*BooleanNode, error)

func (NumberNode) AsClassNode

func (_ NumberNode) AsClassNode() (*ClassNode, error)

func (NumberNode) AsJsonNode

func (_ NumberNode) AsJsonNode() (*JsonNode, error)

func (NumberNode) AsNullNode

func (_ NumberNode) AsNullNode() (*NullNode, error)

func (*NumberNode) AsNumberNode

func (n *NumberNode) AsNumberNode() (*NumberNode, error)

func (NumberNode) AsOffsetDateTimeNode

func (_ NumberNode) AsOffsetDateTimeNode() (*OffsetDateTimeNode, error)

func (NumberNode) AsPathNode

func (_ NumberNode) AsPathNode() (*PathNode, error)

func (NumberNode) AsPatternNode

func (_ NumberNode) AsPatternNode() (*PatternNode, error)

func (NumberNode) AsPredicateNode

func (_ NumberNode) AsPredicateNode() (*PredicateNode, error)

func (*NumberNode) AsStringNode

func (n *NumberNode) AsStringNode() (*StringNode, error)

func (NumberNode) AsUndefinedNode

func (_ NumberNode) AsUndefinedNode() (*UndefinedNode, error)

func (NumberNode) AsValueListNode

func (_ NumberNode) AsValueListNode() (*ValueListNode, error)

func (*NumberNode) Equals

func (n *NumberNode) Equals(o interface{}) bool

func (*NumberNode) GetNumber

func (n *NumberNode) GetNumber() *decimal.Decimal

func (NumberNode) IsBooleanNode

func (n NumberNode) IsBooleanNode() bool

func (NumberNode) IsClassNode

func (n NumberNode) IsClassNode() bool

func (NumberNode) IsJsonNode

func (n NumberNode) IsJsonNode() bool

func (NumberNode) IsNullNode

func (n NumberNode) IsNullNode() bool

func (*NumberNode) IsNumberNode

func (n *NumberNode) IsNumberNode() bool

func (NumberNode) IsOffsetDateTimeNode

func (n NumberNode) IsOffsetDateTimeNode() bool

func (NumberNode) IsPathNode

func (n NumberNode) IsPathNode() bool

func (NumberNode) IsPatternNode

func (n NumberNode) IsPatternNode() bool

func (NumberNode) IsPredicateNode

func (n NumberNode) IsPredicateNode() bool

func (*NumberNode) IsStringNode

func (n *NumberNode) IsStringNode() bool

func (NumberNode) IsUndefinedNode

func (n NumberNode) IsUndefinedNode() bool

func (NumberNode) IsValueListNode

func (n NumberNode) IsValueListNode() bool

func (*NumberNode) String

func (n *NumberNode) String() string

func (*NumberNode) TypeOf

type OffsetDateTime

type OffsetDateTime struct {
}

OffsetDateTime -----

func (*OffsetDateTime) String

func (o *OffsetDateTime) String() string

type OffsetDateTimeNode

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

OffsetDateTimeNode -----------

func CreateOffsetDateTimeNode

func CreateOffsetDateTimeNode(str string) *OffsetDateTimeNode

func (OffsetDateTimeNode) AsBooleanNode

func (_ OffsetDateTimeNode) AsBooleanNode() (*BooleanNode, error)

func (OffsetDateTimeNode) AsClassNode

func (_ OffsetDateTimeNode) AsClassNode() (*ClassNode, error)

func (OffsetDateTimeNode) AsJsonNode

func (_ OffsetDateTimeNode) AsJsonNode() (*JsonNode, error)

func (OffsetDateTimeNode) AsNullNode

func (_ OffsetDateTimeNode) AsNullNode() (*NullNode, error)

func (OffsetDateTimeNode) AsNumberNode

func (_ OffsetDateTimeNode) AsNumberNode() (*NumberNode, error)

func (*OffsetDateTimeNode) AsOffsetDateTimeNode

func (n *OffsetDateTimeNode) AsOffsetDateTimeNode() (*OffsetDateTimeNode, error)

func (OffsetDateTimeNode) AsPathNode

func (_ OffsetDateTimeNode) AsPathNode() (*PathNode, error)

func (OffsetDateTimeNode) AsPatternNode

func (_ OffsetDateTimeNode) AsPatternNode() (*PatternNode, error)

func (OffsetDateTimeNode) AsPredicateNode

func (_ OffsetDateTimeNode) AsPredicateNode() (*PredicateNode, error)

func (*OffsetDateTimeNode) AsStringNode

func (n *OffsetDateTimeNode) AsStringNode() (*StringNode, error)

func (OffsetDateTimeNode) AsUndefinedNode

func (_ OffsetDateTimeNode) AsUndefinedNode() (*UndefinedNode, error)

func (OffsetDateTimeNode) AsValueListNode

func (_ OffsetDateTimeNode) AsValueListNode() (*ValueListNode, error)

func (*OffsetDateTimeNode) Equals

func (n *OffsetDateTimeNode) Equals(o interface{}) bool

func (*OffsetDateTimeNode) GetDate

func (n *OffsetDateTimeNode) GetDate() *OffsetDateTime

func (OffsetDateTimeNode) IsBooleanNode

func (n OffsetDateTimeNode) IsBooleanNode() bool

func (OffsetDateTimeNode) IsClassNode

func (n OffsetDateTimeNode) IsClassNode() bool

func (OffsetDateTimeNode) IsJsonNode

func (n OffsetDateTimeNode) IsJsonNode() bool

func (OffsetDateTimeNode) IsNullNode

func (n OffsetDateTimeNode) IsNullNode() bool

func (OffsetDateTimeNode) IsNumberNode

func (n OffsetDateTimeNode) IsNumberNode() bool

func (*OffsetDateTimeNode) IsOffsetDateTimeNode

func (n *OffsetDateTimeNode) IsOffsetDateTimeNode() bool

func (OffsetDateTimeNode) IsPathNode

func (n OffsetDateTimeNode) IsPathNode() bool

func (OffsetDateTimeNode) IsPatternNode

func (n OffsetDateTimeNode) IsPatternNode() bool

func (OffsetDateTimeNode) IsPredicateNode

func (n OffsetDateTimeNode) IsPredicateNode() bool

func (*OffsetDateTimeNode) IsStringNode

func (n *OffsetDateTimeNode) IsStringNode() bool

func (OffsetDateTimeNode) IsUndefinedNode

func (n OffsetDateTimeNode) IsUndefinedNode() bool

func (OffsetDateTimeNode) IsValueListNode

func (n OffsetDateTimeNode) IsValueListNode() bool

func (*OffsetDateTimeNode) String

func (n *OffsetDateTimeNode) String() string

func (*OffsetDateTimeNode) TypeOf

type PathCompiler

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

type PathNode

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

PathNode ------PathNode-----

func CreatePathNode

func CreatePathNode(path common.Path, existsCheck bool, shouldExist bool) *PathNode

func CreatePathNodeWithString

func CreatePathNodeWithString(pathString string, existsCheck bool, shouldExist bool) (*PathNode, error)

func (PathNode) AsBooleanNode

func (_ PathNode) AsBooleanNode() (*BooleanNode, error)

func (PathNode) AsClassNode

func (_ PathNode) AsClassNode() (*ClassNode, error)

func (*PathNode) AsExistsCheck

func (pn *PathNode) AsExistsCheck(shouldExist bool) *PathNode

func (PathNode) AsJsonNode

func (_ PathNode) AsJsonNode() (*JsonNode, error)

func (PathNode) AsNullNode

func (_ PathNode) AsNullNode() (*NullNode, error)

func (PathNode) AsNumberNode

func (_ PathNode) AsNumberNode() (*NumberNode, error)

func (PathNode) AsOffsetDateTimeNode

func (_ PathNode) AsOffsetDateTimeNode() (*OffsetDateTimeNode, error)

func (*PathNode) AsPathNode

func (pn *PathNode) AsPathNode() (*PathNode, error)

func (PathNode) AsPatternNode

func (_ PathNode) AsPatternNode() (*PatternNode, error)

func (PathNode) AsPredicateNode

func (_ PathNode) AsPredicateNode() (*PredicateNode, error)

func (PathNode) AsStringNode

func (_ PathNode) AsStringNode() (*StringNode, error)

func (PathNode) AsUndefinedNode

func (_ PathNode) AsUndefinedNode() (*UndefinedNode, error)

func (PathNode) AsValueListNode

func (_ PathNode) AsValueListNode() (*ValueListNode, error)

func (*PathNode) Equals

func (pn *PathNode) Equals(o interface{}) bool

func (*PathNode) Evaluate

func (pn *PathNode) Evaluate(ctx common.PredicateContext) (ValueNode, error)

func (*PathNode) GetPath

func (pn *PathNode) GetPath() common.Path

func (PathNode) IsBooleanNode

func (n PathNode) IsBooleanNode() bool

func (PathNode) IsClassNode

func (n PathNode) IsClassNode() bool

func (*PathNode) IsExistsCheck

func (pn *PathNode) IsExistsCheck() bool

func (PathNode) IsJsonNode

func (n PathNode) IsJsonNode() bool

func (PathNode) IsNullNode

func (n PathNode) IsNullNode() bool

func (PathNode) IsNumberNode

func (n PathNode) IsNumberNode() bool

func (PathNode) IsOffsetDateTimeNode

func (n PathNode) IsOffsetDateTimeNode() bool

func (*PathNode) IsPathNode

func (pn *PathNode) IsPathNode() bool

func (PathNode) IsPatternNode

func (n PathNode) IsPatternNode() bool

func (PathNode) IsPredicateNode

func (n PathNode) IsPredicateNode() bool

func (PathNode) IsStringNode

func (n PathNode) IsStringNode() bool

func (PathNode) IsUndefinedNode

func (n PathNode) IsUndefinedNode() bool

func (PathNode) IsValueListNode

func (n PathNode) IsValueListNode() bool

func (*PathNode) ShouldExists

func (pn *PathNode) ShouldExists() bool

func (*PathNode) String

func (pn *PathNode) String() string

func (*PathNode) TypeOf

func (pn *PathNode) TypeOf(ctx common.PredicateContext) reflect.Kind

type PatternNode

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

PatternNode -------patternNode------

func CreatePatternNodeByRegexp

func CreatePatternNodeByRegexp(pattern *regexp.Regexp) *PatternNode

func CreatePatternNodeByString

func CreatePatternNodeByString(pattern string) (*PatternNode, error)

func (PatternNode) AsBooleanNode

func (_ PatternNode) AsBooleanNode() (*BooleanNode, error)

func (PatternNode) AsClassNode

func (_ PatternNode) AsClassNode() (*ClassNode, error)

func (PatternNode) AsJsonNode

func (_ PatternNode) AsJsonNode() (*JsonNode, error)

func (PatternNode) AsNullNode

func (_ PatternNode) AsNullNode() (*NullNode, error)

func (PatternNode) AsNumberNode

func (_ PatternNode) AsNumberNode() (*NumberNode, error)

func (PatternNode) AsOffsetDateTimeNode

func (_ PatternNode) AsOffsetDateTimeNode() (*OffsetDateTimeNode, error)

func (PatternNode) AsPathNode

func (_ PatternNode) AsPathNode() (*PathNode, error)

func (*PatternNode) AsPatternNode

func (pn *PatternNode) AsPatternNode() (*PatternNode, error)

func (PatternNode) AsPredicateNode

func (_ PatternNode) AsPredicateNode() (*PredicateNode, error)

func (PatternNode) AsStringNode

func (_ PatternNode) AsStringNode() (*StringNode, error)

func (PatternNode) AsUndefinedNode

func (_ PatternNode) AsUndefinedNode() (*UndefinedNode, error)

func (PatternNode) AsValueListNode

func (_ PatternNode) AsValueListNode() (*ValueListNode, error)

func (*PatternNode) Equals

func (pn *PatternNode) Equals(o interface{}) bool

func (*PatternNode) GetCompiledPattern

func (pn *PatternNode) GetCompiledPattern() *regexp.Regexp

func (PatternNode) IsBooleanNode

func (n PatternNode) IsBooleanNode() bool

func (PatternNode) IsClassNode

func (n PatternNode) IsClassNode() bool

func (PatternNode) IsJsonNode

func (n PatternNode) IsJsonNode() bool

func (PatternNode) IsNullNode

func (n PatternNode) IsNullNode() bool

func (PatternNode) IsNumberNode

func (n PatternNode) IsNumberNode() bool

func (PatternNode) IsOffsetDateTimeNode

func (n PatternNode) IsOffsetDateTimeNode() bool

func (PatternNode) IsPathNode

func (n PatternNode) IsPathNode() bool

func (*PatternNode) IsPatternNode

func (pn *PatternNode) IsPatternNode() bool

func (PatternNode) IsPredicateNode

func (n PatternNode) IsPredicateNode() bool

func (PatternNode) IsStringNode

func (n PatternNode) IsStringNode() bool

func (PatternNode) IsUndefinedNode

func (n PatternNode) IsUndefinedNode() bool

func (PatternNode) IsValueListNode

func (n PatternNode) IsValueListNode() bool

func (*PatternNode) String

func (pn *PatternNode) String() string

func (*PatternNode) TypeOf

type PredicateNode

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

PredicateNode -----------

func CreatePredicateNode

func CreatePredicateNode(p common.Predicate) *PredicateNode

func (PredicateNode) AsBooleanNode

func (_ PredicateNode) AsBooleanNode() (*BooleanNode, error)

func (PredicateNode) AsClassNode

func (_ PredicateNode) AsClassNode() (*ClassNode, error)

func (PredicateNode) AsJsonNode

func (_ PredicateNode) AsJsonNode() (*JsonNode, error)

func (PredicateNode) AsNullNode

func (_ PredicateNode) AsNullNode() (*NullNode, error)

func (PredicateNode) AsNumberNode

func (_ PredicateNode) AsNumberNode() (*NumberNode, error)

func (PredicateNode) AsOffsetDateTimeNode

func (_ PredicateNode) AsOffsetDateTimeNode() (*OffsetDateTimeNode, error)

func (PredicateNode) AsPathNode

func (_ PredicateNode) AsPathNode() (*PathNode, error)

func (PredicateNode) AsPatternNode

func (_ PredicateNode) AsPatternNode() (*PatternNode, error)

func (*PredicateNode) AsPredicateNode

func (n *PredicateNode) AsPredicateNode() (*PredicateNode, error)

func (PredicateNode) AsStringNode

func (_ PredicateNode) AsStringNode() (*StringNode, error)

func (PredicateNode) AsUndefinedNode

func (_ PredicateNode) AsUndefinedNode() (*UndefinedNode, error)

func (PredicateNode) AsValueListNode

func (_ PredicateNode) AsValueListNode() (*ValueListNode, error)

func (*PredicateNode) Equals

func (n *PredicateNode) Equals(o interface{}) bool

func (*PredicateNode) GetPredicate

func (n *PredicateNode) GetPredicate() common.Predicate

func (PredicateNode) IsBooleanNode

func (n PredicateNode) IsBooleanNode() bool

func (PredicateNode) IsClassNode

func (n PredicateNode) IsClassNode() bool

func (PredicateNode) IsJsonNode

func (n PredicateNode) IsJsonNode() bool

func (PredicateNode) IsNullNode

func (n PredicateNode) IsNullNode() bool

func (PredicateNode) IsNumberNode

func (n PredicateNode) IsNumberNode() bool

func (PredicateNode) IsOffsetDateTimeNode

func (n PredicateNode) IsOffsetDateTimeNode() bool

func (PredicateNode) IsPathNode

func (n PredicateNode) IsPathNode() bool

func (PredicateNode) IsPatternNode

func (n PredicateNode) IsPatternNode() bool

func (*PredicateNode) IsPredicateNode

func (n *PredicateNode) IsPredicateNode() bool

func (PredicateNode) IsStringNode

func (n PredicateNode) IsStringNode() bool

func (PredicateNode) IsUndefinedNode

func (n PredicateNode) IsUndefinedNode() bool

func (PredicateNode) IsValueListNode

func (n PredicateNode) IsValueListNode() bool

func (*PredicateNode) String

func (n *PredicateNode) String() string

func (*PredicateNode) TypeOf

type RelationExpressionNode

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

func CreateRelationExpressionNode

func CreateRelationExpressionNode(valueNode1 ValueNode, operator string, valueNode2 ValueNode) *RelationExpressionNode

func (*RelationExpressionNode) Apply

func (*RelationExpressionNode) ExpressionNodeLabel

func (e *RelationExpressionNode) ExpressionNodeLabel()

func (*RelationExpressionNode) String

func (e *RelationExpressionNode) String() string

type StringNode

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

StringNode -----------

func CreateStringNode

func CreateStringNode(str string, escape bool) (*StringNode, error)

func (StringNode) AsBooleanNode

func (_ StringNode) AsBooleanNode() (*BooleanNode, error)

func (StringNode) AsClassNode

func (_ StringNode) AsClassNode() (*ClassNode, error)

func (StringNode) AsJsonNode

func (_ StringNode) AsJsonNode() (*JsonNode, error)

func (StringNode) AsNullNode

func (_ StringNode) AsNullNode() (*NullNode, error)

func (*StringNode) AsNumberNode

func (n *StringNode) AsNumberNode() (*NumberNode, error)

func (StringNode) AsOffsetDateTimeNode

func (_ StringNode) AsOffsetDateTimeNode() (*OffsetDateTimeNode, error)

func (StringNode) AsPathNode

func (_ StringNode) AsPathNode() (*PathNode, error)

func (StringNode) AsPatternNode

func (_ StringNode) AsPatternNode() (*PatternNode, error)

func (StringNode) AsPredicateNode

func (_ StringNode) AsPredicateNode() (*PredicateNode, error)

func (*StringNode) AsStringNode

func (n *StringNode) AsStringNode() (*StringNode, error)

func (StringNode) AsUndefinedNode

func (_ StringNode) AsUndefinedNode() (*UndefinedNode, error)

func (StringNode) AsValueListNode

func (_ StringNode) AsValueListNode() (*ValueListNode, error)

func (*StringNode) Contains

func (n *StringNode) Contains(str1 string) bool

func (*StringNode) Equals

func (n *StringNode) Equals(o interface{}) bool

func (*StringNode) GetString

func (n *StringNode) GetString() string

func (StringNode) IsBooleanNode

func (n StringNode) IsBooleanNode() bool

func (StringNode) IsClassNode

func (n StringNode) IsClassNode() bool

func (*StringNode) IsEmpty

func (n *StringNode) IsEmpty() bool

func (StringNode) IsJsonNode

func (n StringNode) IsJsonNode() bool

func (StringNode) IsNullNode

func (n StringNode) IsNullNode() bool

func (*StringNode) IsNumberNode

func (n *StringNode) IsNumberNode() bool

func (StringNode) IsOffsetDateTimeNode

func (n StringNode) IsOffsetDateTimeNode() bool

func (StringNode) IsPathNode

func (n StringNode) IsPathNode() bool

func (StringNode) IsPatternNode

func (n StringNode) IsPatternNode() bool

func (StringNode) IsPredicateNode

func (n StringNode) IsPredicateNode() bool

func (*StringNode) IsStringNode

func (n *StringNode) IsStringNode() bool

func (StringNode) IsUndefinedNode

func (n StringNode) IsUndefinedNode() bool

func (StringNode) IsValueListNode

func (n StringNode) IsValueListNode() bool

func (*StringNode) Length

func (n *StringNode) Length() int

func (*StringNode) String

func (n *StringNode) String() string

func (*StringNode) TypeOf

type UndefinedNode

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

UndefinedNode -----------

func NewUndefinedNode

func NewUndefinedNode() *UndefinedNode

func (UndefinedNode) AsBooleanNode

func (_ UndefinedNode) AsBooleanNode() (*BooleanNode, error)

func (UndefinedNode) AsClassNode

func (_ UndefinedNode) AsClassNode() (*ClassNode, error)

func (UndefinedNode) AsJsonNode

func (_ UndefinedNode) AsJsonNode() (*JsonNode, error)

func (UndefinedNode) AsNullNode

func (_ UndefinedNode) AsNullNode() (*NullNode, error)

func (UndefinedNode) AsNumberNode

func (_ UndefinedNode) AsNumberNode() (*NumberNode, error)

func (UndefinedNode) AsOffsetDateTimeNode

func (_ UndefinedNode) AsOffsetDateTimeNode() (*OffsetDateTimeNode, error)

func (UndefinedNode) AsPathNode

func (_ UndefinedNode) AsPathNode() (*PathNode, error)

func (UndefinedNode) AsPatternNode

func (_ UndefinedNode) AsPatternNode() (*PatternNode, error)

func (UndefinedNode) AsPredicateNode

func (_ UndefinedNode) AsPredicateNode() (*PredicateNode, error)

func (UndefinedNode) AsStringNode

func (_ UndefinedNode) AsStringNode() (*StringNode, error)

func (*UndefinedNode) AsUndefinedNode

func (n *UndefinedNode) AsUndefinedNode() (*UndefinedNode, error)

func (UndefinedNode) AsValueListNode

func (_ UndefinedNode) AsValueListNode() (*ValueListNode, error)

func (*UndefinedNode) Equals

func (n *UndefinedNode) Equals(o interface{}) bool

func (UndefinedNode) IsBooleanNode

func (n UndefinedNode) IsBooleanNode() bool

func (UndefinedNode) IsClassNode

func (n UndefinedNode) IsClassNode() bool

func (UndefinedNode) IsJsonNode

func (n UndefinedNode) IsJsonNode() bool

func (UndefinedNode) IsNullNode

func (n UndefinedNode) IsNullNode() bool

func (UndefinedNode) IsNumberNode

func (n UndefinedNode) IsNumberNode() bool

func (UndefinedNode) IsOffsetDateTimeNode

func (n UndefinedNode) IsOffsetDateTimeNode() bool

func (UndefinedNode) IsPathNode

func (n UndefinedNode) IsPathNode() bool

func (UndefinedNode) IsPatternNode

func (n UndefinedNode) IsPatternNode() bool

func (UndefinedNode) IsPredicateNode

func (n UndefinedNode) IsPredicateNode() bool

func (UndefinedNode) IsStringNode

func (n UndefinedNode) IsStringNode() bool

func (*UndefinedNode) IsUndefinedNode

func (n *UndefinedNode) IsUndefinedNode() bool

func (UndefinedNode) IsValueListNode

func (n UndefinedNode) IsValueListNode() bool

func (*UndefinedNode) String

func (n *UndefinedNode) String() string

func (*UndefinedNode) TypeOf

type ValueListNode

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

ValueListNode -----------

func CreateValueListNode

func CreateValueListNode(list interface{}) (*ValueListNode, error)

func (ValueListNode) AsBooleanNode

func (_ ValueListNode) AsBooleanNode() (*BooleanNode, error)

func (ValueListNode) AsClassNode

func (_ ValueListNode) AsClassNode() (*ClassNode, error)

func (ValueListNode) AsJsonNode

func (_ ValueListNode) AsJsonNode() (*JsonNode, error)

func (ValueListNode) AsNullNode

func (_ ValueListNode) AsNullNode() (*NullNode, error)

func (ValueListNode) AsNumberNode

func (_ ValueListNode) AsNumberNode() (*NumberNode, error)

func (ValueListNode) AsOffsetDateTimeNode

func (_ ValueListNode) AsOffsetDateTimeNode() (*OffsetDateTimeNode, error)

func (ValueListNode) AsPathNode

func (_ ValueListNode) AsPathNode() (*PathNode, error)

func (ValueListNode) AsPatternNode

func (_ ValueListNode) AsPatternNode() (*PatternNode, error)

func (ValueListNode) AsPredicateNode

func (_ ValueListNode) AsPredicateNode() (*PredicateNode, error)

func (ValueListNode) AsStringNode

func (_ ValueListNode) AsStringNode() (*StringNode, error)

func (ValueListNode) AsUndefinedNode

func (_ ValueListNode) AsUndefinedNode() (*UndefinedNode, error)

func (*ValueListNode) AsValueListNode

func (v *ValueListNode) AsValueListNode() (*ValueListNode, error)

func (*ValueListNode) Contains

func (v *ValueListNode) Contains(node ValueNode) bool

func (*ValueListNode) Equals

func (v *ValueListNode) Equals(o interface{}) bool

func (*ValueListNode) GetNodes

func (v *ValueListNode) GetNodes() []ValueNode

func (ValueListNode) IsBooleanNode

func (n ValueListNode) IsBooleanNode() bool

func (ValueListNode) IsClassNode

func (n ValueListNode) IsClassNode() bool

func (ValueListNode) IsJsonNode

func (n ValueListNode) IsJsonNode() bool

func (ValueListNode) IsNullNode

func (n ValueListNode) IsNullNode() bool

func (ValueListNode) IsNumberNode

func (n ValueListNode) IsNumberNode() bool

func (ValueListNode) IsOffsetDateTimeNode

func (n ValueListNode) IsOffsetDateTimeNode() bool

func (ValueListNode) IsPathNode

func (n ValueListNode) IsPathNode() bool

func (ValueListNode) IsPatternNode

func (n ValueListNode) IsPatternNode() bool

func (ValueListNode) IsPredicateNode

func (n ValueListNode) IsPredicateNode() bool

func (ValueListNode) IsStringNode

func (n ValueListNode) IsStringNode() bool

func (ValueListNode) IsUndefinedNode

func (n ValueListNode) IsUndefinedNode() bool

func (*ValueListNode) IsValueListNode

func (v *ValueListNode) IsValueListNode() bool

func (*ValueListNode) String

func (v *ValueListNode) String() string

func (*ValueListNode) SubSetOf

func (v *ValueListNode) SubSetOf(right *ValueListNode) bool

func (*ValueListNode) TypeOf

type ValueNode

type ValueNode interface {
	TypeOf(ctx common.PredicateContext) reflect.Kind

	String() string
	Equals(o interface{}) bool
	// contains filtered or unexported methods
}

func CreateValueNode

func CreateValueNode(o interface{}) (ValueNode, error)

Jump to

Keyboard shortcuts

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