walk

package
v3.0.0-...-18a6489 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LookupSchemaMapPath

func LookupSchemaMapPath(path SchemaPath, schemaMap shim.SchemaMap) (shim.Schema, error)

Similar to LookupSchemaPath but starts the initial step from a SchemaMap.

func LookupSchemaPath

func LookupSchemaPath(path SchemaPath, schema shim.Schema) (shim.Schema, error)

Finds a nested Schema at a given path.

func VisitSchema

func VisitSchema(schema shim.Schema, visitor SchemaVisitor)

Visit all nested schemas, including the current one.

func VisitSchemaMap

func VisitSchemaMap(schemaMap shim.SchemaMap, visitor SchemaVisitor)

Visit all nested schemas in a SchemaMap, keeping track of SchemaPath location.

Types

type ElementStep

type ElementStep struct{}

Drill down into a Map, Set or List element schema.

func (ElementStep) GoString

func (step ElementStep) GoString() string

func (ElementStep) Lookup

func (step ElementStep) Lookup(s shim.Schema) (shim.Schema, error)

type GetAttrStep

type GetAttrStep struct {
	Name string
}

Drill down into an attribute by the given attribute name.

func (GetAttrStep) GoString

func (step GetAttrStep) GoString() string

func (GetAttrStep) Lookup

func (step GetAttrStep) Lookup(s shim.Schema) (shim.Schema, error)

type SchemaPath

type SchemaPath []SchemaPathStep

Represents locations in a tfshim.Schema value as a sequence of steps to locate it.

An empty SchemaPath represents the current location.

Values of this type are immutable by convention, use Copy as necessary for local mutations.

func FromCtyPath

func FromCtyPath(path cty.Path) SchemaPath

Converts a value path to a Schema Path (zclconf package representation).

func FromHCtyPath

func FromHCtyPath(path hcty.Path) SchemaPath

Converts a value path to a Schema Path (hashicorp/go-cty representation).

func NewSchemaPath

func NewSchemaPath() SchemaPath

Builds a new empty SchemaPath.

func (SchemaPath) Copy

func (p SchemaPath) Copy() SchemaPath

func (SchemaPath) Element

func (p SchemaPath) Element() SchemaPath

func (SchemaPath) GetAttr

func (p SchemaPath) GetAttr(name string) SchemaPath

func (SchemaPath) GoString

func (p SchemaPath) GoString() string

func (SchemaPath) WithStep

func (p SchemaPath) WithStep(suffix SchemaPathStep) SchemaPath

type SchemaPathStep

type SchemaPathStep interface {
	GoString() string
	Lookup(shim.Schema) (shim.Schema, error)
	// contains filtered or unexported methods
}

Represents elements of a SchemaPath.

This interface is closed, the only the implementations given in the current package are allowed.

type SchemaVisitor

type SchemaVisitor = func(SchemaPath, shim.Schema)

Jump to

Keyboard shortcuts

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