Documentation ¶
Index ¶
- Constants
- func Filter(node nodes.Node, query string) (query.Iterator, error)
- func FilterBool(node nodes.Node, query string) (bool, error)
- func FilterInt(node nodes.Node, query string) (int, error)
- func FilterNode(node nodes.Node, query string) (nodes.Node, error)
- func FilterNumber(node nodes.Node, query string) (float64, error)
- func FilterString(node nodes.Node, query string) (string, error)
- func FilterValue(node nodes.Node, query string) (nodes.Value, error)
- func Iterate(it Iterator) <-chan nodes.Node
- type Context
- func (c *Context) Filter(query string) (query.Iterator, error)
- func (c *Context) FilterBool(query string) (bool, error)
- func (c *Context) FilterInt(query string) (int, error)
- func (c *Context) FilterNode(query string) (nodes.Node, error)
- func (c *Context) FilterNumber(query string) (float64, error)
- func (c *Context) FilterString(query string) (string, error)
- func (c *Context) FilterValue(query string) (nodes.Value, error)
- type ErrInvalidArgument
- type Iterator
- type TreeOrder
Constants ¶
const ( // PreOrder traversal PreOrder = query.PreOrder // PostOrder traversal PostOrder = query.PostOrder // LevelOrder (aka breadth-first) traversal LevelOrder = query.LevelOrder // PositionOrder by node position in the source file PositionOrder = query.PositionOrder )
Variables ¶
This section is empty.
Functions ¶
func Filter ¶
Filter filters the tree and returns the iterator of nodes that satisfy the given query.
func FilterBool ¶
FilterNode evaluates a query and returns a results as a boolean value.
func FilterNode ¶
FilterNode filters the tree and returns a single node that satisfy the given query.
func FilterNumber ¶
FilterNumber evaluates a query and returns a results as a float64 value.
func FilterString ¶
FilterString evaluates a query and returns a results as a string value.
func FilterValue ¶
FilterValue evaluates a query and returns a results as a value.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func (*Context) Filter ¶
Filter filters the tree and returns the iterator of nodes that satisfy the given query.
func (*Context) FilterBool ¶
FilterNode evaluates a query and returns a results as a boolean value.
func (*Context) FilterNode ¶
FilterNode filters the tree and returns a single node that satisfy the given query.
func (*Context) FilterNumber ¶
FilterNumber evaluates a query and returns a results as a float64 value.
func (*Context) FilterString ¶
FilterString evaluates a query and returns a results as a string value.
type ErrInvalidArgument ¶
type ErrInvalidArgument struct {
Message string
}
func (*ErrInvalidArgument) Error ¶
func (e *ErrInvalidArgument) Error() string