query

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2019 License: Unlicense Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Walk

func Walk(astNode ast.Node, query *Query, action func(node ast.Node, queryNode Node) error) error

Types

type IndexedNode

type IndexedNode interface {
	IsMatch(key string, val ast.Node) bool
	Key() string
	Index() *int
}

type Key

type Key struct {
	// contains filtered or unexported fields
}

func (*Key) IsMatch

func (k *Key) IsMatch(key string, val ast.Node) bool

func (*Key) Key

func (k *Key) Key() string

type List

type List struct {
	// contains filtered or unexported fields
}

func (*List) Index

func (l *List) Index() *int

func (*List) IsMatch

func (l *List) IsMatch(key string, val ast.Node) bool

func (*List) Key

func (l *List) Key() string

type Node

type Node interface {
	IsMatch(key string, val ast.Node) bool
	Key() string
}

type Query

type Query struct {
	Parts  []Node
	Length int
}

func Parse

func Parse(queryString string) (*Query, error)

func (*Query) Slice

func (q *Query) Slice(low int) *Query

type Regex

type Regex struct {
	// contains filtered or unexported fields
}

func (*Regex) Index

func (r *Regex) Index() *int

func (*Regex) IsMatch

func (r *Regex) IsMatch(key string, val ast.Node) bool

func (*Regex) Key

func (r *Regex) Key() string

type Results

type Results struct {
	Values []interface{}
	Node   ast.Node
}

func HCL

func HCL(reader io.Reader, qry *Query) (results Results, isList bool, node *ast.File, err error)

type Wildcard

type Wildcard struct {
}

func (*Wildcard) IsMatch

func (w *Wildcard) IsMatch(key string, val ast.Node) bool

func (*Wildcard) Key

func (w *Wildcard) Key() string

Jump to

Keyboard shortcuts

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