parser

package
v0.77.2 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: Apache-2.0 Imports: 16 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 (*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.

type IPRange added in v0.58.0

type IPRange struct {
	Field string
	From  Term
	To    Term
}

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 (*Literal) DumpSeqQL

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

func (*Literal) Optimize added in v0.77.2

func (n *Literal) Optimize() *Literal

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 PipeLimit added in v0.76.0

type PipeLimit struct {
	Limit int
}

func (*PipeLimit) DumpSeqQL added in v0.76.0

func (l *PipeLimit) DumpSeqQL(o *strings.Builder)

func (*PipeLimit) Name added in v0.76.0

func (l *PipeLimit) Name() string

type PipeOffset added in v0.76.0

type PipeOffset struct {
	Offset int
}

func (*PipeOffset) DumpSeqQL added in v0.76.0

func (l *PipeOffset) DumpSeqQL(o *strings.Builder)

func (*PipeOffset) Name added in v0.76.0

func (l *PipeOffset) Name() string

type PipeSort added in v0.76.0

type PipeSort struct {
	Order string
}

func (*PipeSort) DumpSeqQL added in v0.76.0

func (s *PipeSort) DumpSeqQL(o *strings.Builder)

func (*PipeSort) Name added in v0.76.0

func (s *PipeSort) Name() string

type PipeStats added in v0.76.0

type PipeStats struct {
	Agg StatsAgg
}

func (*PipeStats) DumpSeqQL added in v0.76.0

func (p *PipeStats) DumpSeqQL(o *strings.Builder)

func (*PipeStats) Name added in v0.76.0

func (p *PipeStats) Name() string

type Range

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

func (*Range) DumpSeqQL

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

type Re added in v0.67.0

type Re struct {
	Field string

	Expression         Term
	CompiledExpression *regexp.Regexp

	Prefix ReLiteral
	Middle []ReLiteral
	Suffix ReLiteral
}

func (*Re) DumpSeqQL added in v0.67.0

func (r *Re) DumpSeqQL(b *strings.Builder)

type ReLiteral added in v0.77.1

type ReLiteral struct {
	Value    []byte
	Foldable bool
}

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

func (*SeqQLQuery) ValidateStreamPipes added in v0.76.0

func (q *SeqQLQuery) ValidateStreamPipes() error

ValidateStreamPipes returns an error if the query contains any stream-only pipe (stats, sort, limit, offset). It is used by methods that do not support stream-only pipes to reject them after parsing. ParseSeqQL itself does not perform this check.

type StatsAgg added in v0.76.0

type StatsAgg struct {
	Func      string
	Field     string
	GroupBy   string
	Interval  string
	Quantiles []float64
}

type Term

type Term struct {
	Kind TermKind
	Data string
}

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{}

Jump to

Keyboard shortcuts

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