Documentation
¶
Overview ¶
Package interpreter ...
Index ¶
- Variables
- type Error
- type FilterFunc
- type Interpreter
- func (i *Interpreter) Interpret(root ast.Expr) FilterFunc
- func (i *Interpreter) VisitFilter(e ast.Expr)
- func (i *Interpreter) VisitIdentity(e ast.Expr)
- func (i *Interpreter) VisitInteger(e ast.Expr)
- func (i *Interpreter) VisitIterator(e ast.Expr)
- func (i *Interpreter) VisitQuery(e ast.Expr)
- func (i *Interpreter) VisitRoot(e ast.Expr)
- func (i *Interpreter) VisitSelector(e ast.Expr)
- func (i *Interpreter) VisitSpan(e ast.Expr)
- func (i *Interpreter) VisitString(e ast.Expr)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrTOMLDataType indicates unexpected data type passed to the function. ErrTOMLDataType = errors.New("wrong type error") )
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error ...
type FilterFunc ¶
FilterFunc specifies the data transformation function type.
type Interpreter ¶
type Interpreter struct {
// contains filtered or unexported fields
}
Interpreter interprets the tq query AST into a pipe-like sequence of filtering functions processing TOML input data as specified in the query.
func (*Interpreter) Interpret ¶
func (i *Interpreter) Interpret(root ast.Expr) FilterFunc
Interpret extracts a sequence of filtering functions by traversing the AST. It returns an entry function that takes in deserialized TOML data and applies filtering functions in the sequence provided by the Interpreter.
func (*Interpreter) VisitFilter ¶
func (i *Interpreter) VisitFilter(e ast.Expr)
VisitFilter interprets the Filter AST node.
func (*Interpreter) VisitIdentity ¶
func (i *Interpreter) VisitIdentity(e ast.Expr)
VisitIdentity interprets the Identity AST node.
func (*Interpreter) VisitInteger ¶
func (i *Interpreter) VisitInteger(e ast.Expr)
VisitInteger interprets the Integer AST node.
func (*Interpreter) VisitIterator ¶
func (i *Interpreter) VisitIterator(e ast.Expr)
VisitIterator interprets the Iterator AST node.
func (*Interpreter) VisitQuery ¶
func (i *Interpreter) VisitQuery(e ast.Expr)
VisitQuery interprets the Query AST node.
func (*Interpreter) VisitRoot ¶
func (i *Interpreter) VisitRoot(e ast.Expr)
VisitRoot interprets the Root AST node.
func (*Interpreter) VisitSelector ¶
func (i *Interpreter) VisitSelector(e ast.Expr)
VisitSelector interprets the Selector AST node.
func (*Interpreter) VisitSpan ¶
func (i *Interpreter) VisitSpan(e ast.Expr)
VisitSpan interprets the Span AST node.
func (*Interpreter) VisitString ¶
func (i *Interpreter) VisitString(e ast.Expr)
VisitString interprets the String AST node.