typeutils

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureTypedList added in v0.14.0

func EnsureTypedList(ctx context.Context, list types.List, elemType attr.Type) types.List

EnsureTypedList converts untyped zero-value lists to properly typed null lists. This is commonly needed during import operations where the framework may create untyped lists with DynamicPseudoType elements, which causes type conversion errors. If the list already has a proper type, it is returned unchanged.

func NonEmptyListOrDefault added in v0.13.1

func NonEmptyListOrDefault[T any](ctx context.Context, original types.List, elemType attr.Type, slice []T) (types.List, diag.Diagnostics)

func NonEmptySetOrDefault added in v0.13.1

func NonEmptySetOrDefault[T any](ctx context.Context, original types.Set, elemType attr.Type, slice []T) (types.Set, diag.Diagnostics)

func NonEmptyStringishPointerValue

func NonEmptyStringishPointerValue[T ~string](ptr *T) types.String

func NonEmptyStringishValue

func NonEmptyStringishValue[T ~string](value T) types.String

func StringishPointerValue

func StringishPointerValue[T ~string](ptr *T) types.String

StringishPointerValue converts a pointer to a string-like type to a Terraform types.String value.

func StringishValue

func StringishValue[T ~string](value T) types.String

StringishValue converts a value of any string-like type T to a Terraform types.String.

Types

This section is empty.

Jump to

Keyboard shortcuts

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