helper

package
v0.3.22 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DifferenceBy added in v0.3.7

func DifferenceBy[T any](
	list1 []T,
	list2 []T,
	predicate func(T, T) bool,
) ([]T, []T)

Same as Difference but with a predicate function to compare elements.

func DocString added in v0.3.3

func DocString(inp string) string

useful for docs

func EmptySetDefault

func EmptySetDefault(elemType attr.Type) defaults.Set

func Int64SetToIntSlice added in v0.3.5

func Int64SetToIntSlice(set types.Set) []int

TF types to API data types

func IntPointerToInt64Pointer added in v0.3.4

func IntPointerToInt64Pointer(value *int) *int64

func IntersectBy added in v0.3.7

func IntersectBy[T any](list1 []T, list2 []T, predicate func(T, T) bool) []T

Same as Intersect but with a predicate function to compare elements.

func SetIntToInt64OrNull added in v0.3.3

func SetIntToInt64OrNull(value int) types.Int64

API data types to TF types

func SliceStringToSliceTypesInt64 added in v0.3.10

func SliceStringToSliceTypesInt64(input []int) []types.Int64

func SliceStringToSliceTypesString added in v0.3.10

func SliceStringToSliceTypesString(input []string) []types.String

func SplitIDToInts added in v0.3.18

func SplitIDToInts(id string, resource_type string) (int, int, error)

func SplitIDToStrings added in v0.3.18

func SplitIDToStrings(id string, resource_type string) (string, string, error)

func StringSetToStringSlice added in v0.3.7

func StringSetToStringSlice(set types.Set) []string

func TypesInt64ToInt64Pointer added in v0.3.11

func TypesInt64ToInt64Pointer(value types.Int64) *int64

func TypesStringSliceToStringSlice added in v0.3.11

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

func UnionBy added in v0.3.7

func UnionBy[T any](
	list1 []T,
	list2 []T,
	predicate func(T, T) bool,
) []T

Same as Union but with a predicate function to compare elements. Note that items need to be unique already in list1 and list2

Types

This section is empty.

Jump to

Keyboard shortcuts

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