utils

package
v2.13.1 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllCrossed added in v2.7.0

func AllCrossed[Slice ~[]E, E comparable](s Slice) iter.Seq2[E, int]

func CompareByMap added in v2.7.0

func CompareByMap[E cmp.Ordered](m map[E]int, fallbackCompare func(a, b E) int) func(a, b E) int

func CopyGenericMaps

func CopyGenericMaps[T any](target map[string]T, source map[string]T)

func CopyMaps

func CopyMaps(target map[string]schema.Attribute, source map[string]schema.Attribute)

func GenID

func GenID() string

func GoObjectToTerraformString

func GoObjectToTerraformString(v interface{}, jsonEscapeHTML bool) (types.String, error)

func InterfaceToStringArray

func InterfaceToStringArray(o interface{}) []string

func IsDone added in v2.13.0

func IsDone(ctx context.Context) bool

func Map added in v2.7.0

func Map[S, R any](items []S, fn func(S) R) []R

func PtrTo added in v2.13.0

func PtrTo[T any](v T) *T

PtrTo returns a pointer to the given value

func SimpleCompare added in v2.7.0

func SimpleCompare[E cmp.Ordered](a, b E) int

func SortSliceByOther added in v2.7.0

func SortSliceByOther[Slice ~[]E, E cmp.Ordered](slice, other Slice, fallbackCompare func(a, b E) int) Slice

SortSliceByOther sorts `slice` by the positioning of equal items that exist in the `other` slice.

You can also provide `fallbackCompare` to be used if both items don't exist in the `other` slice. If only a single item is missing from the `other` slice, it will do a simple compare (a > b / a < b / a == b).

func SortStringSliceByOther added in v2.7.0

func SortStringSliceByOther(slice, other []string) []string

func TFStringListToStringArray

func TFStringListToStringArray(list []types.String) []string

func TerraformJsonStringToGoObject

func TerraformJsonStringToGoObject(v *string) (*map[string]any, error)

func TerraformListToGoArray

func TerraformListToGoArray(ctx context.Context, list types.List, arrayType string) ([]interface{}, error)

func TerraformStringToBooleanOrString added in v2.0.16

func TerraformStringToBooleanOrString(s types.String) interface{}

func TerraformStringToGoType added in v2.0.4

func TerraformStringToGoType[T any](s types.String) (T, error)

Types

type StringErr added in v2.5.0

type StringErr string

func (StringErr) Error added in v2.5.0

func (e StringErr) Error() string

Jump to

Keyboard shortcuts

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