ctyutils

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyJSONToCtyValue

func AnyJSONToCtyValue(jsonStr []byte) (cty.Value, error)

AnyJSONToCtyValue converts an aribitrary json byte slice and converts to a corresponding cty.Value

NOTE: This method effectively parses the JSON string twice. Once via unmarshal called directly, then again via ctyjson.ImpliedType which runs a decoder. It is likely worth the time to write a decoder that directly takes the unmarshalled json and manually maps to cty values. This function is quite expensive as an overall portion of the runtime. Taking around 200-250µs for a single change event (around 20-25% of hops parsing time).

func ConvertCtyValueToInterface

func ConvertCtyValueToInterface(val cty.Value) (interface{}, error)

ConvertCtyValueToInterface converts a cty.Value to an interface{}.

Calls itself recursively to convert nested values. Does not cover all possible cty types, such as unknown, capsule, empty object, and empty tuple.

func EventBundleToCty

func EventBundleToCty(eventBundle map[string][]byte, pathDelim string) (map[string]cty.Value, error)

func ParseEventVar

func ParseEventVar(evalVars map[string]cty.Value, metaKey string) (string, string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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