Documentation ¶
Index ¶
- func CloseOrLogError(ctx context.Context) func(io.Closer)
- func ConvertToStringSlice(interfaceSlice []interface{}) []string
- func GetAnyBoolEnv(ks ...string) bool
- func GetAnyIntEnv(ks ...string) int
- func GetAnyStringEnv(ks ...string) string
- func ListResourcesAttributeValue(resourceList []interface{}, keyAttr string) []string
- func MapDiff[T any](plan map[string]T, state map[string]T) (map[string]T, map[string]T, map[string]T)
- func MapResourcesByAttribute(resourceList []interface{}, keyAttr string) map[string]interface{}
- func OrderedListFromMap(inputMap map[string]interface{}) []interface{}
- func OrderedListFromMapByKeyValues(inputMap map[string]interface{}, keyList []string) []interface{}
- func SetDiff[T any](plan []T, state []T, keyFunc func(t T) string) ([]T, []T, []T)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloseOrLogError ¶
CloseOrLogError closes the given io.Closer and logs any error.
func ConvertToStringSlice ¶ added in v0.46.5
func ConvertToStringSlice(interfaceSlice []interface{}) []string
ConvertToStringSlice helps convert interface slice to string slice.
func GetAnyBoolEnv ¶ added in v0.22.0
GetAnyBoolEnv returns the first non-empty boolean value from the environment variables.
func GetAnyIntEnv ¶ added in v0.52.0
GetAnyIntEnv returns the first non-empty integer value from the environment variables.
func GetAnyStringEnv ¶ added in v0.22.0
GetAnyStringEnv returns the first non-empty string value from the environment variables.
func ListResourcesAttributeValue ¶ added in v0.57.0
ListResourcesAttributeValue generates a list of strings from a Terraform resource list (which is list of maps). The list is generated by extracting a specific key attribute from each resource. If the attribute is not found in a resource, it is skipped.
func MapDiff ¶ added in v0.59.1
func MapDiff[T any](plan map[string]T, state map[string]T) (map[string]T, map[string]T, map[string]T)
MapDiff compares the difference between two maps and returns the elements that are in the plan but not in the state (toCreate), the elements that are in the plan and in the state but are different (toUpdate), and the elements that are in the state but not in the plan (toDelete). The keyFunc is used to extract a unique key from each element to compare them.
func MapResourcesByAttribute ¶ added in v0.57.0
MapResourcesByAttribute generates a map of resources from a resource list, using a specified attribute as the key and the resource as the value. If the attribute is not found in a resource, it is skipped.
func OrderedListFromMap ¶ added in v0.47.0
func OrderedListFromMap(inputMap map[string]interface{}) []interface{}
OrderedListFromMap generates a list from a map's values. The values are sorted based on the map's keys.
func OrderedListFromMapByKeyValues ¶ added in v0.52.0
OrderedListFromMapByKeyValues generates a list from a map's values. The values are sorted based on the provided key list. If a key is not found in the map, it is skipped.
func SetDiff ¶ added in v0.59.1
SetDiff compares two slices of elements and returns the elements that are in the plan but not in the state (toCreate), the elements that are in the plan and in the state but are different (toUpdate), and the elements that are in the state but not in the plan (toDelete). The keyFunc is used to extract a unique key from each element to compare them.
Types ¶
This section is empty.