flex

package
v0.0.67 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiffStringSet added in v0.0.55

func DiffStringSet(
	ctx context.Context,
	a types.Set,
	b types.Set,
	diags *diag.Diagnostics,
) []types.String

DiffStringSet returns items that exist in a but not in b (set difference: a - b).

func ExpandListAs added in v0.0.52

func ExpandListAs[T any](
	ctx context.Context,
	list types.List,
	diags *diag.Diagnostics,
) []T

ExpandListAs converts a Terraform Framework types.List into a Go slice of the specified type. If the list is null or unknown, it returns an empty slice.

func ExpandSetAs added in v0.0.52

func ExpandSetAs[T any](
	ctx context.Context,
	set types.Set,
	diags *diag.Diagnostics,
) []T

ExpandSetAs converts a Terraform Framework types.Set into a Go slice of the specified type. If the set is null or unknown, it returns an empty slice.

func FlattenHostGroupsToList added in v0.0.62

func FlattenHostGroupsToList(
	ctx context.Context,
	groups []*models.HostGroupsHostGroupV1,
) (types.List, diag.Diagnostics)

FlattenHostGroupsToList converts []*models.HostGroupsHostGroupV1 to a Terraform list of host group IDs. Returns null if there are no groups or all groups are nil/have nil IDs.

func FlattenHostGroupsToSet added in v0.0.62

func FlattenHostGroupsToSet(
	ctx context.Context,
	groups []*models.HostGroupsHostGroupV1,
) (types.Set, diag.Diagnostics)

FlattenHostGroupsToSet converts []*models.HostGroupsHostGroupV1 to a Terraform set of host group IDs. Returns null if there are no groups or all groups are nil/have nil IDs.

func FlattenStringValueList added in v0.0.62

func FlattenStringValueList(
	ctx context.Context,
	values []string,
) (types.List, diag.Diagnostics)

FlattenStringValueList converts a slice of strings to a Terraform list of strings. Returns null if the slice is empty or nil.

func FlattenStringValueSet added in v0.0.62

func FlattenStringValueSet(
	ctx context.Context,
	values []string,
) (types.Set, diag.Diagnostics)

FlattenStringValueSet converts a slice of strings to a Terraform set of strings. Returns null if the slice is empty or nil.

func FrameworkToInt32Pointer added in v0.0.62

func FrameworkToInt32Pointer(v types.Int32) *int32

FrameworkToInt32Pointer converts a Terraform framework types.Int32 to an int32 pointer. If the framework int32 is null or unknown, it returns nil.

func FrameworkToRFC3339Pointer added in v0.0.61

func FrameworkToRFC3339Pointer(v timetypes.RFC3339) *string

FrameworkToRFC3339Pointer converts a Terraform framework timetypes.RFC3339 to a string pointer. If the framework RFC3339 is null or unknown, it returns a pointer to an empty string.

func FrameworkToStringPointer added in v0.0.50

func FrameworkToStringPointer(v types.String) *string

FrameworkToStringPointer converts a Terraform framework types.String to a string pointer. If the framework string is null or unknown, it returns a pointer to an empty string.

func Int32PointerToFramework added in v0.0.62

func Int32PointerToFramework(v *int32) types.Int32

Int32PointerToFramework converts an int32 pointer to a Terraform framework types.Int32. A nil pointer returns a null types.Int32.

func MergeStringSet added in v0.0.55

func MergeStringSet(
	ctx context.Context,
	a types.Set,
	b types.Set,
	diags *diag.Diagnostics,
) types.Set

MergeStringSet combines two sets and returns a new set containing unique items from both.

func RFC3339PointerToFramework added in v0.0.61

func RFC3339PointerToFramework(v *string) (timetypes.RFC3339, diag.Diagnostics)

RFC3339PointerToFramework converts a string pointer to a Terraform framework timetypes.RFC3339. A nil pointer or empty string returns a null timetypes.RFC3339.

func RFC3339ValueToFramework added in v0.0.61

func RFC3339ValueToFramework[T ~string](v T) (timetypes.RFC3339, diag.Diagnostics)

RFC3339ValueToFramework converts a string to a Terraform framework timetypes.RFC3339. An empty string returns a null timetypes.RFC3339.

func StringPointerToFramework

func StringPointerToFramework(v *string) types.String

StringPointerToFramework converts a string pointer to a Terraform framework types.String. A nil pointer or empty string returns a null types.String.

func StringValueToFramework

func StringValueToFramework[T ~string](v T) types.String

StringValueToFramework converts a string to a Terraform framework types.String. An empty string returns a null types.String.

func Unique added in v0.0.52

func Unique[E comparable](s []E) []E

Unique returns a new slice containing only the unique elements from the input slice. It works for any comparable type E and preserves the order of first occurrence.

Types

This section is empty.

Jump to

Keyboard shortcuts

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