Documentation ¶
Index ¶
- 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 BlockRange(block *hcl.Block) hcl.Range
- func BlockRangePointer(block *hcl.Block) *hcl.Range
- 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 ConvertMapInterfaceToCtyValue(v interface{}) (cty.Value, error)
- func ConvertMapOrSliceToCtyValue(data interface{}) (cty.Value, error)
- func ConvertMapToCtyValue[K comparable, V any](v map[K]V) (cty.Value, error)
- func ConvertSliceToCtyValue[T SliceTypeConstraint](v T) (cty.Value, error)
- func CtyToGo(v cty.Value) (val interface{}, err error)
- func CtyToGoBoolSlice(v cty.Value, typ cty.Type) (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, typ cty.Type) (val []float64, err error)
- func CtyToGoStringSlice(v cty.Value, typ cty.Type) (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 GoToHCLString(data interface{}) (string, error)
- func GoToPostgresString(v any) (string, error)
- func GoTypeMatchesCtyType(val interface{}, ctyType cty.Type) bool
- func HclBodyToHclString(body hcl.Body, excludeContent *hcl.BodyContent) (string, hcl.Diagnostics)
- func HclSyntaxBlockRangePointer(block *hclsyntax.Block) *hcl.Range
- func IsValueCompatibleWithType(ctyType cty.Type, value cty.Value) bool
- func JSONToHcl(jsonString string) (string, hcl.Diagnostics)
- func QuotePostgresBytes(buf []byte) string
- func QuotePostgresString(str string) string
- func ResourceNameFromTraversal(resourceType string, traversal hcl.Traversal) (string, bool)
- func TraversalAsString(traversal hcl.Traversal) string
- func TraversalAsStringSlice(traversal hcl.Traversal) []string
- func TraversalsEqual(t1, t2 hcl.Traversal) bool
- type SliceTypeConstraint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttributeToBool ¶
func AttributeToInt ¶
func AttributeToMap ¶
func AttributeToString ¶
func BlockRange ¶
func BlockRange(block *hcl.Block) hcl.Range
func BlockRangePointer ¶
func BlockRangePointer(block *hcl.Block) *hcl.Range
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 ConvertMapToCtyValue[K comparable, V any](v map[K]V) (cty.Value, error)
func ConvertSliceToCtyValue ¶
func ConvertSliceToCtyValue[T SliceTypeConstraint](v T) (cty.Value, error)
ConvertSliceToCtyValue converts a slice of various types to cty.Value
func CtyToGoInterfaceSlice ¶
func CtyToGoNumericSlice ¶
func CtyToGoStringSlice ¶
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 GoToHCLString ¶ added in v1.5.0
GoToHCLString converts a Go data structure to an HCL string.
func GoToPostgresString ¶
GoToPostgresString convert a go value into a postgres representation of the value
func GoTypeMatchesCtyType ¶
func HclBodyToHclString ¶
func HclBodyToHclString(body hcl.Body, excludeContent *hcl.BodyContent) (string, hcl.Diagnostics)
HclBodyToHclString builds a hcl string with all attributes in the connection config which are NOT specified in the coneciton block schema this is passed to the plugin who will validate and parse it
func IsValueCompatibleWithType ¶ added in v0.3.0
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