typeutils

package
v0.1.0-beta.9 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DynamicToJSON

func DynamicToJSON(d types.Dynamic) ([]byte, error)

DynamicToJSON converts dynamic types to JSON.

func IsFullyKnown

func IsFullyKnown(val attr.Value) bool

IsFullyKnown returns true if `val` is known. If `val` is an aggregate type, IsFullyKnown only returns true if all elements and attributes are known, as well.

func JSONToDynamic

func JSONToDynamic(b []byte, typ attr.Type) (types.Dynamic, error)

JSONToDynamic converts JSON to dynamic types.

func JSONToDynamicImplied

func JSONToDynamicImplied(b []byte) (types.Dynamic, error)

JSONToDynamicImplied is similar to FromJSON, while it is for typeless case. In which case, the following type conversion rules are applied (Go -> TF): - bool: bool - float64: number - string: string - []interface{}: tuple - map[string]interface{}: object - nil: null (dynamic) In case the input json is of zero-length, it returns null (dynamic).

func SemanticallyEqual

func SemanticallyEqual(a, b types.Dynamic) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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