Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Breadcrumbs ¶
Breadcrumbs represents the dot.style.query that the user passes in.
func ParseBreadcrumbs ¶
func ParseBreadcrumbs(queryString string) (*Breadcrumbs, error)
ParseBreadcrumbs reads in a query string specified by the user and breaks it down into Crumb instances that can be matched against HCL keys with IsMatch.
type Crumb ¶
Crumb represents an individual portion of a user's query. For example, given the query 'data.*.bar.id', each of data, *, bar, and id are each crumbs. Crumbs implement IsMatch to determine whether or not it can be used to match a given HCL key.
type IndexedCrumb ¶
type IndexedCrumb interface { IsMatch(key string, val ast.Node) (bool, error) Key() string Index() *int }
IndexedCrumb is a type of Crumb used for indexable elements such as arrays or lists. Its index is optional and will be nil if no index was specified. For example, in the query 'foo.bar[1]', the bar[1] portion will be represented by an IndexedCrumb with an index of 1. If an index is not present, such as with 'bar[]', the index will be nil.
type Key ¶
type Key struct {
// contains filtered or unexported fields
}
Key is a literal breadcrumb that matches based on its exact value.
type List ¶
type List struct {
// contains filtered or unexported fields
}
List is a breadcrumb representing a list or array, either the entire list or just an individual item.