hclext

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDotReferenceFromTraversal

func CreateDotReferenceFromTraversal(traversals ...hcl.Traversal) string

func DecodeVarType

func DecodeVarType(exp hcl.Expression) (cty.Type, *typeexpr.Defaults, error)

func ExportOutputs

func ExportOutputs(modules terraform.Modules) cty.Value

func InsertTupleElement

func InsertTupleElement(list cty.Value, idx int, val cty.Value) cty.Value

InsertTupleElement inserts a value into a tuple at the specified index. If the idx is outside the bounds of the list, it grows the tuple to the new size, and fills in `cty.NilVal` for the missing elements.

This function will not panic. If the list value is not a list, it will be replaced with an empty list.

func MergeObjects

func MergeObjects(a, b cty.Value) cty.Value

func MergeWithTupleElement

func MergeWithTupleElement(list cty.Value, idx int, val cty.Value) cty.Value

func ReferenceNames

func ReferenceNames(exp hcl.Expression) []string

func Serialize

func Serialize(blocks terraform.Blocks) string

Serialize makes a best effort to serialize the blocks back to HCL. This is not guaranteed to be the same as the original HCL, and should only be used for debugging.

Types

type ReferenceBuilder

type ReferenceBuilder []hcl.Traverser

func NewReferenceBuilder

func NewReferenceBuilder(path ...string) *ReferenceBuilder

func (*ReferenceBuilder) AddIndex

func (b *ReferenceBuilder) AddIndex(idx int) *ReferenceBuilder

func (*ReferenceBuilder) AddKey

func (b *ReferenceBuilder) AddKey(key string) *ReferenceBuilder

func (*ReferenceBuilder) AddPath

func (b *ReferenceBuilder) AddPath(path ...string) *ReferenceBuilder

func (ReferenceBuilder) Expression

func (b ReferenceBuilder) Expression() hcl.Expression

Jump to

Keyboard shortcuts

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