parser

package
v0.61.2 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogicalOr logicalKind = iota
	LogicalAnd
	LogicalNot
	LogicalNAnd // created in `process`
)

Variables

This section is empty.

Functions

func GetField

func GetField(token Token) string

func GetHint

func GetHint(token Token) string

Types

type ASTNode

type ASTNode struct {
	Children []*ASTNode
	Value    Token
}

func ParseQuery

func ParseQuery(data string, mapping seq.Mapping) (*ASTNode, error)

func (*ASTNode) Dump

func (e *ASTNode) Dump(builder *strings.Builder)

Dump is used in tests only

func (*ASTNode) DumpSeqQL

func (e *ASTNode) DumpSeqQL(b *strings.Builder)

func (*ASTNode) SeqQLString

func (e *ASTNode) SeqQLString() string

SeqQLString it is like String, but for SeqQL.

func (*ASTNode) String

func (e *ASTNode) String() string

String is used in tests only

type IPRange added in v0.58.0

type IPRange struct {
	Field string
	From  Term
	To    Term
}

func (*IPRange) Dump added in v0.58.0

func (n *IPRange) Dump(builder *strings.Builder)

func (*IPRange) DumpSeqQL added in v0.58.0

func (n *IPRange) DumpSeqQL(b *strings.Builder)

type Literal

type Literal struct {
	Field string
	Terms []Term
}

func ParseAggregationFilter

func ParseAggregationFilter(data string) (*Literal, error)

func (*Literal) Dump

func (n *Literal) Dump(builder *strings.Builder)

func (*Literal) DumpSeqQL

func (n *Literal) DumpSeqQL(o *strings.Builder)

func (*Literal) String

func (n *Literal) String() string

type Logical

type Logical struct {
	Operator logicalKind
}

type Pipe

type Pipe interface {
	Name() string
	DumpSeqQL(*strings.Builder)
}

type PipeFields

type PipeFields struct {
	Fields []string
	Except bool
}

func (*PipeFields) DumpSeqQL

func (f *PipeFields) DumpSeqQL(o *strings.Builder)

func (*PipeFields) Name

func (f *PipeFields) Name() string

type Range

type Range struct {
	Field       string
	From        Term
	To          Term
	IncludeFrom bool
	IncludeTo   bool
}

func (*Range) Dump

func (n *Range) Dump(builder *strings.Builder)

func (*Range) DumpSeqQL

func (n *Range) DumpSeqQL(b *strings.Builder)

type SeqQLQuery

type SeqQLQuery struct {
	Root  *ASTNode
	Pipes []Pipe
}

func ParseSeqQL

func ParseSeqQL(q string, mapping seq.Mapping) (SeqQLQuery, error)

func (*SeqQLQuery) SeqQLString

func (q *SeqQLQuery) SeqQLString() string

type Term

type Term struct {
	Kind TermKind
	Data string
}

func (Term) Dump

func (t Term) Dump(builder *strings.Builder)

func (Term) DumpSeqQL

func (t Term) DumpSeqQL(b *strings.Builder)

func (Term) IsWildcard

func (t Term) IsWildcard() bool

type TermKind

type TermKind int
const (
	TermText TermKind = iota
	TermSymbol
)

type Token

type Token interface{}

func ParseSingleTokenForTests

func ParseSingleTokenForTests(name, data string) (Token, error)

Jump to

Keyboard shortcuts

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