query

package
v2.14.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2019 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IterAny       = nodes.IterAny
	PreOrder      = nodes.PreOrder
	PostOrder     = nodes.PostOrder
	LevelOrder    = nodes.LevelOrder
	PositionOrder = LevelOrder + iota + 1
)

Variables

This section is empty.

Functions

func AllNodes

func AllNodes(it Iterator) []nodes.External

AllNodes iterates over all nodes and returns them as a slice.

func Count

func Count(it Iterator) int

Count counts the nodes in the iterator. Iterator will be exhausted as a result.

Types

type Empty

type Empty = nodes.Empty

type Interface

type Interface interface {
	// Prepare parses the query and prepares it for repeated execution.
	Prepare(query string) (Query, error)
	// Execute prepares and runs a query for a given subtree.
	Execute(root nodes.External, query string) (Iterator, error)
}

type IterOrder

type IterOrder = nodes.IterOrder

type Iterator

type Iterator = nodes.Iterator

func NewIterator

func NewIterator(root nodes.External, order IterOrder) Iterator

type Query

type Query interface {
	// Execute runs a query for a given subtree.
	Execute(root nodes.External) (Iterator, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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