schemautil

package
v0.14.5 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddConnectionSchema

func AddConnectionSchema(providedSchema map[string]*schema.Schema)

Returns the common connection schema for all the Elasticsearch resources, which defines the fields which can be used to configure the API access

func ConvertSettingsKeyToTFFieldKey added in v0.5.0

func ConvertSettingsKeyToTFFieldKey(settingKey string) string

func DefaultIfNil added in v0.11.16

func DefaultIfNil[T any](value *T) T

func Deref added in v0.11.8

func Deref[T any](value *T) T

Deref returns the value referenced by the given pointer. If the value is nil, a zero value is returned.

func ExpandIndividuallyDefinedSettings added in v0.5.0

func ExpandIndividuallyDefinedSettings(ctx context.Context, d *schema.ResourceData, settingsKeys map[string]schema.ValueType) map[string]any

func FlipMap added in v0.7.0

func FlipMap[K comparable, V comparable](m map[K]V) map[V]K

func FormatStrictDateTime added in v0.5.0

func FormatStrictDateTime(t time.Time) string

func IsEmpty

func IsEmpty(v any) bool

func Itol added in v0.11.12

func Itol(value *int) *int64

Itol converts *int to *in64.

func JSONBytesEqual

func JSONBytesEqual(a, b []byte) (bool, error)

Compares the JSON in two byte slices

func Ltoi added in v0.11.12

func Ltoi(value *int64) *int

Ltoi converts *int64 to *int.

func MapRef added in v0.11.8

func MapRef[T any, M ~map[string]T](value M) *M

MapRef is similar to new(value), in that it takes the reference of the given value, however if the value is already nil then it returns nil rather than a pointer to nil.

func MergeSchemaMaps

func MergeSchemaMaps(maps ...map[string]*schema.Schema) map[string]*schema.Schema

func NonNilSlice added in v0.11.16

func NonNilSlice[T any](s []T) []T

Returns an empty slice if s is a slice represented by nil (no backing array). Guarantees that json.Marshal and terraform parameters will not treat the empty slice as null.

func SliceRef added in v0.11.8

func SliceRef[T any, S ~[]T](value S) *S

SliceRef is similar to new(value), in that it takes the reference of the given value, however if the value is already nil then it returns nil rather than a pointer to nil.

func StringToHash added in v0.3.0

func StringToHash(s string) (*string, error)

func TimeToStringValue added in v0.11.18

func TimeToStringValue(t time.Time) types.String

TimeToStringValue formats a time.Time to ISO 8601 format and returns a types.StringValue. This is a convenience function that combines FormatStrictDateTime and types.StringValue.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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