Back to godoc.org

Package query

v0.1.9
Latest Go to latest

The latest major version is .

Published: Jan 29, 2019 | License: Unlicense | Module: github.com/LudovicTOURMAN/hclq

Index

func Walk

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

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

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier