Documentation ¶
Index ¶
- func AnySliceToTypedSlice(input any) any
- func AttributeToBool(attr *hcl.Attribute, evalContext *hcl.EvalContext, allowExpression bool) (*bool, hcl.Diagnostics)
- func AttributeToInt(attr *hcl.Attribute, evalContext *hcl.EvalContext, allowExpression bool) (*int64, hcl.Diagnostics)
- func AttributeToMap(attr *hcl.Attribute, evalContext *hcl.EvalContext, allowExpression bool) (map[string]interface{}, hcl.Diagnostics)
- func AttributeToString(attr *hcl.Attribute, evalContext *hcl.EvalContext, allowExpression bool) (*string, hcl.Diagnostics)
- func BlocksToMap(blocks hcl.Blocks) map[string]*hcl.Block
- func CoerceStringToGoBasedOnCtyType(input string, typ cty.Type) (interface{}, error)
- func ConvertInterfaceToCtyValue(v interface{}) (cty.Value, error)
- func ConvertMapOrSliceToCtyValue(data interface{}) (cty.Value, error)
- func ConvertMapToCtyValue(v interface{}) (cty.Value, error)
- func CtyToGo(v cty.Value) (val interface{}, err error)
- func CtyToGoBoolSlice(v cty.Value) (val []bool, err error)
- func CtyToGoInterfaceSlice(v cty.Value) (val []interface{}, err error)
- func CtyToGoMapBool(v cty.Value) (map[string]bool, error)
- func CtyToGoMapInterface(v cty.Value) (map[string]interface{}, error)
- func CtyToGoMapNumeric(v cty.Value) (map[string]float64, error)
- func CtyToGoMapString(v cty.Value) (map[string]string, error)
- func CtyToGoNumericSlice(v cty.Value) (val []float64, err error)
- func CtyToGoStringSlice(v cty.Value) (val []string, err error)
- func CtyToInt64(val cty.Value) (*int64, hcl.Diagnostics)
- func CtyToJSON(val cty.Value) (string, error)
- func CtyToPostgresString(v cty.Value) (valStr string, err error)
- func CtyToString(v cty.Value) (valStr string, err error)
- func CtyTupleToArrayOfStrings(val cty.Value) ([]string, error)
- func CtyTypeToHclType(types ...cty.Type) string
- func ExpressionToDepends(expr hcl.Expression, validDependsOnTypes []string) ([]string, hcl.Diagnostics)
- func ExpressionsEqual(expr1, expr2 hcl.Expression) bool
- func FindChildBlocks(parentBlock *hcl.Block, blockType string) hcl.Blocks
- func FindFirstChildBlock(parentBlock *hcl.Block, blockType string) *hcl.Block
- func GetFirstBlockOfType(blocks hcl.Blocks, blockType string) *hcl.Block
- func GoToPostgresString(v any) (string, error)
- func GoTypeMatchesCtyType(val interface{}, ctyType cty.Type) bool
- func QuotePostgresBytes(buf []byte) string
- func QuotePostgresString(str string) string
- func ResourceNameFromTraversal(resourceType string, traversal hcl.Traversal) (string, bool)
- func ToTypedSlice[T any](input []any) []T
- func TraversalAsString(traversal hcl.Traversal) string
- func TraversalAsStringSlice(traversal hcl.Traversal) []string
- func TraversalsEqual(t1, t2 hcl.Traversal) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnySliceToTypedSlice ¶
AnySliceToTypedSlice determines whether input is []any and if so converts to an array of the underlying type
func AttributeToBool ¶
func AttributeToInt ¶
func AttributeToMap ¶
func AttributeToString ¶
func BlocksToMap ¶
func BlocksToMap(blocks hcl.Blocks) map[string]*hcl.Block
BlocksToMap convert an array of blocks to a map keyed by block laabel NOTE: this panics if any blocks do not have a label
func ConvertMapToCtyValue ¶
func CtyToGoInterfaceSlice ¶
func CtyToInt64 ¶
func CtyToPostgresString ¶
CtyToPostgresString convert a cty value into a postgres representation of the value
func CtyToString ¶
CtyToString convert a cty value into a string representation of the value
func CtyTypeToHclType ¶
CtyTypeToHclType converts a cty type to a hcl type accept multiple types and use the first non null and non dynamic one
func ExpressionToDepends ¶
func ExpressionsEqual ¶
func ExpressionsEqual(expr1, expr2 hcl.Expression) bool
func FindChildBlocks ¶
func FindChildBlocks(parentBlock *hcl.Block, blockType string) hcl.Blocks
func FindFirstChildBlock ¶
func FindFirstChildBlock(parentBlock *hcl.Block, blockType string) *hcl.Block
func GetFirstBlockOfType ¶
func GetFirstBlockOfType(blocks hcl.Blocks, blockType string) *hcl.Block
func GoToPostgresString ¶
GoToPostgresString convert a go value into a postgres representation of the value
func GoTypeMatchesCtyType ¶
func QuotePostgresBytes ¶
QuotePostgresBytes taken from github.com/jackc/pgx/v5@v4.17.2/internal/sanitize/sanitize.go
func QuotePostgresString ¶
QuotePostgresString taken from github.com/jackc/pgx/v5@v4.17.2/internal/sanitize/sanitize.go
func ResourceNameFromTraversal ¶
ResourceNameFromTraversal converts a traversal to the name of the referenced resource We must take into account possible mod-name as first traversal element
func TraversalAsString ¶
func TraversalAsString(traversal hcl.Traversal) string
TraversalAsString converts a traversal to a path string (if an absolute traversal is passed - convert to relative)
func TraversalAsStringSlice ¶
func TraversalAsStringSlice(traversal hcl.Traversal) []string
TraversalAsStringSlice converts a traversal to a path string (if an absolute traversal is passed - convert to relative)
func TraversalsEqual ¶
func TraversalsEqual(t1, t2 hcl.Traversal) bool
Types ¶
This section is empty.