flex

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// A common separator to be used for creating resource Ids from a combination of attributes
	ResourceIdSeparator = ","
)

Variables

This section is empty.

Functions

func ExpandBoolMap

func ExpandBoolMap(m map[string]interface{}) map[string]*bool

Expands a map of string to interface to a map of string to *bool

func ExpandFloat64List

func ExpandFloat64List(configured []interface{}) []*float64

Takes the result of flatmap.Expand for an array of float64 and returns a []*float64

func ExpandInt32Map

func ExpandInt32Map(m map[string]interface{}) map[string]int32

Expands a map of string to interface to a map of string to int32

func ExpandInt64List

func ExpandInt64List(configured []interface{}) []*int64

Takes the result of flatmap.Expand for an array of int64 and returns a []*int64

func ExpandInt64Map

func ExpandInt64Map(m map[string]interface{}) map[string]*int64

Expands a map of string to interface to a map of string to *int64

func ExpandInt64Set

func ExpandInt64Set(configured *schema.Set) []*int64

Takes the result of schema.Set of strings and returns a []*int64

func ExpandResourceId

func ExpandResourceId(id string, partCount int, allowEmptyPart bool) ([]string, error)

Takes a string of resource attributes separated by the ResourceIdSeparator constant, an expected number of Id Parts, and a boolean specifying if empty parts are to be allowed Returns a list of the resource attributes strings used to construct the unique Id or an error message if the resource id does not parse properly

func ExpandStringList

func ExpandStringList(configured []interface{}) []*string

ExpandStringList the result of flatmap.Expand for an array of strings and returns a []*string. Empty strings are skipped.

func ExpandStringListEmpty

func ExpandStringListEmpty(configured []interface{}) []*string

ExpandStringListEmpty the result of flatmap. Expand for an array of strings and returns a []*string. Adds an empty element for every nil or uncastable.

func ExpandStringMap

func ExpandStringMap(m map[string]interface{}) map[string]*string

Expands a map of string to interface to a map of string to *string

func ExpandStringSet

func ExpandStringSet(configured *schema.Set) []*string

Takes the result of schema.Set of strings and returns a []*string

func ExpandStringTimeList

func ExpandStringTimeList(configured []interface{}, format string) []*time.Time

Takes the result of flatmap.Expand for an array of strings and returns a []*time.Time

func ExpandStringValueList

func ExpandStringValueList(configured []interface{}) []string

ExpandStringValueList takes the result of flatmap.Expand for an array of strings and returns a []string

func ExpandStringValueMap

func ExpandStringValueMap(m map[string]interface{}) map[string]string

ExpandStringValueMap expands a string map of interfaces to a string map of strings

func ExpandStringValueSet

func ExpandStringValueSet(configured *schema.Set) []string

func ExpandStringyValueList

func ExpandStringyValueList[E ~string](configured []any) []E

func ExpandStringyValueSet

func ExpandStringyValueSet[E ~string](configured *schema.Set) []E

func FlattenFloat64List

func FlattenFloat64List(list []*float64) []interface{}

Takes list of pointers to float64s. Expand to an array of raw floats and returns a []interface{} to keep compatibility w/ schema.NewSet

func FlattenInt64List

func FlattenInt64List(list []*int64) []interface{}

Takes list of pointers to int64s. Expand to an array of raw ints and returns a []interface{} to keep compatibility w/ schema.NewSet

func FlattenInt64Set

func FlattenInt64Set(list []*int64) *schema.Set

func FlattenResourceId

func FlattenResourceId(idParts []string, partCount int, allowEmptyPart bool) (string, error)

Takes a list of the resource attributes as strings used to construct the unique Id, an expected number of Id Parts, and a boolean specifying if empty parts are to be allowed Returns a string of resource attributes separated by the ResourceIdSeparator constant or an error message if the id parts do not parse properly

func FlattenStringList

func FlattenStringList(list []*string) []interface{}

Takes list of pointers to strings. Expand to an array of raw strings and returns a []interface{} to keep compatibility w/ schema.NewSetschema.NewSet

func FlattenStringSet

func FlattenStringSet(list []*string) *schema.Set

func FlattenStringValueList

func FlattenStringValueList(list []string) []interface{}

Takes list of strings. Expand to an array of raw strings and returns a []interface{} to keep compatibility w/ schema.NewSetschema.NewSet

func FlattenStringValueSet

func FlattenStringValueSet(list []string) *schema.Set

func FlattenTimeStringList

func FlattenTimeStringList(list []*time.Time, format string) []interface{}

Takes list of pointers to time.Time. Expand to an array of strings and returns a []interface{}

func PointersMapToStringList

func PointersMapToStringList(pointers map[string]*string) map[string]interface{}

func ResourceIdPartCount

func ResourceIdPartCount(id string) int

Takes a string of resource attributes separated by the ResourceIdSeparator constant returns the number of parts

func StringToBoolValue

func StringToBoolValue(v *string) bool

StringToBoolValue converts a string pointer to a Go bool value. Only the string "true" is converted to true, all other values return false.

Types

type Set

type Set[T comparable] []T

func (Set[T]) Difference

func (s Set[T]) Difference(ns Set[T]) Set[T]

Difference find the elements in two sets that are not similar.

Jump to

Keyboard shortcuts

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