fieldpath

package
v0.0.0-...-9bbed00 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BinaryCondition

type BinaryCondition struct {
	Left     Expression
	Operator string
	Right    Expression
}

func (*BinaryCondition) EvalCondition

func (e *BinaryCondition) EvalCondition(ctx context.Context, o interface{}) (bool, error)

func (*BinaryCondition) String

func (e *BinaryCondition) String() string

type Condition

type Condition interface {
	fmt.Stringer
	EvalCondition(ctx context.Context, m interface{}) (bool, error)
}

func ParseCondition

func ParseCondition(s string) (Condition, error)

type Expression

type Expression interface {
	fmt.Stringer
	Eval(ctx context.Context, m interface{}) (interface{}, bool, error)
}

func ParseExpression

func ParseExpression(s string) (Expression, error)

type IdentifierExpression

type IdentifierExpression struct {
	Key string
}

func (*IdentifierExpression) Eval

func (e *IdentifierExpression) Eval(ctx context.Context, o interface{}) (interface{}, bool, error)

func (*IdentifierExpression) String

func (e *IdentifierExpression) String() string

type IndexExpression

type IndexExpression struct {
	Base  Expression
	Key   string
	Style string
}

func (*IndexExpression) Eval

func (e *IndexExpression) Eval(ctx context.Context, o interface{}) (interface{}, bool, error)

func (*IndexExpression) String

func (e *IndexExpression) String() string

type LiteralExpression

type LiteralExpression struct {
	Value string
}

func (*LiteralExpression) Eval

func (e *LiteralExpression) Eval(ctx context.Context, o interface{}) (interface{}, bool, error)

func (*LiteralExpression) String

func (e *LiteralExpression) String() string

type NegateCondition

type NegateCondition struct {
	Inner Condition
}

func (*NegateCondition) EvalCondition

func (e *NegateCondition) EvalCondition(ctx context.Context, o interface{}) (bool, error)

func (*NegateCondition) String

func (e *NegateCondition) String() string

type Parser

type Parser struct {
	lexparse.BaseParser
}

func (*Parser) Init

func (p *Parser) Init(s string)

func (*Parser) ParseCondition

func (p *Parser) ParseCondition() (Condition, error)

func (*Parser) ParseExpression

func (p *Parser) ParseExpression() (Expression, error)

type TruthyCondition

type TruthyCondition struct {
	Expr Expression
}

func (*TruthyCondition) EvalCondition

func (e *TruthyCondition) EvalCondition(ctx context.Context, o interface{}) (bool, error)

func (*TruthyCondition) String

func (e *TruthyCondition) String() string

Jump to

Keyboard shortcuts

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