Documentation ¶
Index ¶
- func AddConnectionSchema(providedSchema map[string]*schema.Schema)
- func CheckError(res *esapi.Response, errMsg string) sdkdiag.Diagnostics
- func CheckHttpError(res *http.Response, errMsg string) sdkdiag.Diagnostics
- func CheckHttpErrorFromFW(res *http.Response, errMsg string) fwdiag.Diagnostics
- func ConvertSDKDiagnosticsToFramework(sdkDiags sdkdiag.Diagnostics) fwdiag.Diagnostics
- func ConvertSettingsKeyToTFFieldKey(settingKey string) string
- func ConvertToAttrDiags(diags fwdiag.Diagnostics, path path.Path) fwdiag.Diagnostics
- func Deref[T any](value *T) T
- func DiffIndexSettingSuppress(k, old, new string, d *schema.ResourceData) bool
- func DiffJsonSuppress(k, old, new string, d *schema.ResourceData) bool
- func DiffNullMapEntriesSuppress(key, old, new string, d *schema.ResourceData) bool
- func ExpandIndividuallyDefinedSettings(ctx context.Context, d *schema.ResourceData, ...) map[string]interface{}
- func ExpandStringSet(set *schema.Set) []string
- func FlattenMap(m map[string]interface{}) map[string]interface{}
- func FlipMap[K comparable, V comparable](m map[K]V) map[V]K
- func FormatStrictDateTime(t time.Time) string
- func FrameworkDiagFromError(err error) fwdiag.Diagnostics
- func FrameworkDiagsFromSDK(sdkDiags sdkdiag.Diagnostics) fwdiag.Diagnostics
- func FwDiagsAsError(diags fwdiag.Diagnostics) error
- func IsEmpty(v interface{}) bool
- func IsKnown(value attr.Value) bool
- func Itol(value *int) *int64
- func JSONBytesEqual(a, b []byte) (bool, error)
- func ListTypeAs[T any](ctx context.Context, value types.List, p path.Path, diags *diag.Diagnostics) []T
- func ListTypeToMap[T1 any, T2 any](ctx context.Context, value types.List, p path.Path, diags *diag.Diagnostics, ...) map[string]T2
- func ListTypeToSlice[T1 any, T2 any](ctx context.Context, value types.List, p path.Path, diags *diag.Diagnostics, ...) []T2
- func ListTypeToSlice_String(ctx context.Context, value types.List, p path.Path, diags *diag.Diagnostics) []string
- func ListValueFrom[T any](ctx context.Context, value []T, elemType attr.Type, p path.Path, ...) types.List
- func Ltoi(value *int64) *int
- func MapRef[T any, M ~map[string]T](value M) *M
- func MapToMapType[T1 any, T2 any](ctx context.Context, value map[string]T1, elemType attr.Type, p path.Path, ...) types.Map
- func MapToNormalizedType[T any](value map[string]T, p path.Path, diags *diag.Diagnostics) jsontypes.Normalized
- func MapTypeAs[T any](ctx context.Context, value types.Map, p path.Path, diags *diag.Diagnostics) map[string]T
- func MapTypeToMap[T1 any, T2 any](ctx context.Context, value types.Map, p path.Path, diags *diag.Diagnostics, ...) map[string]T2
- func MapValueFrom[T any](ctx context.Context, value map[string]T, elemType attr.Type, p path.Path, ...) types.Map
- func MapsEqual(m1, m2 interface{}) bool
- func MergeSchemaMaps(maps ...map[string]*schema.Schema) map[string]*schema.Schema
- func NewDebugTransport(name string, transport http.RoundTripper) *debugRoundTripper
- func NormalizeIndexSettings(m map[string]interface{}) map[string]interface{}
- func NormalizedTypeToMap[T any](value jsontypes.Normalized, p path.Path, diags *diag.Diagnostics) map[string]T
- func ObjectTypeAs[T any](ctx context.Context, value types.Object, p path.Path, diags *diag.Diagnostics) *T
- func ObjectTypeToStruct[T1 any, T2 any](ctx context.Context, value types.Object, p path.Path, diags *diag.Diagnostics, ...) *T2
- func ObjectValueFrom[T any](ctx context.Context, value *T, attrTypes map[string]attr.Type, p path.Path, ...) types.Object
- func Pointer[T any](value T) *T
- func PrettyPrintJSONLines(b []byte) string
- func SdkDiagsAsError(diags sdkdiag.Diagnostics) error
- func SliceRef[T any, S ~[]T](value S) *S
- func SliceToListType[T1 any, T2 any](ctx context.Context, value []T1, elemType attr.Type, p path.Path, ...) types.List
- func SliceToListType_String(ctx context.Context, value []string, p path.Path, diags *diag.Diagnostics) types.List
- func StringIsDuration(i interface{}, k string) (warnings []string, errors []error)
- func StringIsElasticDuration(i interface{}, k string) (warnings []string, errors []error)
- func StringIsHours(i interface{}, k string) (warnings []string, errors []error)
- func StringToHash(s string) (*string, error)
- func StructToObjectType[T1 any, T2 any](ctx context.Context, value *T1, attrTypes map[string]attr.Type, p path.Path, ...) types.Object
- func TestCheckResourceListAttr(name, key string, values []string) resource.TestCheckFunc
- func TransformMap[T1 any, T2 any](ctx context.Context, value map[string]T1, p path.Path, diags *diag.Diagnostics, ...) map[string]T2
- func TransformMapToSlice[T1 any, T2 any](ctx context.Context, value map[string]T1, p path.Path, diags *diag.Diagnostics, ...) []T2
- func TransformObject[T1 any, T2 any](ctx context.Context, value *T1, p path.Path, diags *diag.Diagnostics, ...) *T2
- func TransformSlice[T1 any, T2 any](ctx context.Context, value []T1, p path.Path, diags *diag.Diagnostics, ...) []T2
- func TransformSliceToMap[T1 any, T2 any](ctx context.Context, value []T1, p path.Path, diags *diag.Diagnostics, ...) map[string]T2
- func ValueStringPointer(value types.String) *string
- type ListMeta
- type MapMeta
- type ObjectMeta
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddConnectionSchema ¶
Returns the common connection schema for all the Elasticsearch resources, which defines the fields which can be used to configure the API access
func CheckError ¶
func CheckError(res *esapi.Response, errMsg string) sdkdiag.Diagnostics
func CheckHttpError ¶ added in v0.6.0
func CheckHttpError(res *http.Response, errMsg string) sdkdiag.Diagnostics
func CheckHttpErrorFromFW ¶ added in v0.11.0
func CheckHttpErrorFromFW(res *http.Response, errMsg string) fwdiag.Diagnostics
func ConvertSDKDiagnosticsToFramework ¶ added in v0.11.7
func ConvertSDKDiagnosticsToFramework(sdkDiags sdkdiag.Diagnostics) fwdiag.Diagnostics
func ConvertSettingsKeyToTFFieldKey ¶ added in v0.5.0
func ConvertToAttrDiags ¶ added in v0.11.7
func ConvertToAttrDiags(diags fwdiag.Diagnostics, path path.Path) fwdiag.Diagnostics
ConvertToAttrDiags wraps an existing collection of diagnostics with an attribute path.
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 DiffIndexSettingSuppress ¶ added in v0.2.0
func DiffIndexSettingSuppress(k, old, new string, d *schema.ResourceData) bool
func DiffJsonSuppress ¶
func DiffJsonSuppress(k, old, new string, d *schema.ResourceData) bool
func DiffNullMapEntriesSuppress ¶ added in v0.6.0
func DiffNullMapEntriesSuppress(key, old, new string, d *schema.ResourceData) bool
func ExpandIndividuallyDefinedSettings ¶ added in v0.5.0
func ExpandStringSet ¶ added in v0.4.0
func FlattenMap ¶
Flattens the multilevel map, and concatenates keys together with dot "." # Examples map of form:
map := map[string]interface{}{ "index": map[string]interface{}{ "key": 1 } }
becomes:
map := map[string]interface{}{ "index.key": 1 }
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 FrameworkDiagFromError ¶ added in v0.11.10
func FrameworkDiagFromError(err error) fwdiag.Diagnostics
func FrameworkDiagsFromSDK ¶ added in v0.11.7
func FrameworkDiagsFromSDK(sdkDiags sdkdiag.Diagnostics) fwdiag.Diagnostics
func FwDiagsAsError ¶ added in v0.11.8
func FwDiagsAsError(diags fwdiag.Diagnostics) error
func JSONBytesEqual ¶
Compares the JSON in two byte slices
func ListTypeAs ¶ added in v0.11.8
func ListTypeAs[T any](ctx context.Context, value types.List, p path.Path, diags *diag.Diagnostics) []T
ListTypeAs converts a types.List into a tfsdk aware []T.
func ListTypeToMap ¶ added in v0.11.8
func ListTypeToMap[T1 any, T2 any](ctx context.Context, value types.List, p path.Path, diags *diag.Diagnostics, iteratee func(item T1, meta ListMeta) (key string, elem T2)) map[string]T2
ListTypeToMap converts a types.List first into a tfsdk aware map[string]T1 and transforms the result into a map[string]T2.
func ListTypeToSlice ¶ added in v0.11.8
func ListTypeToSlice[T1 any, T2 any](ctx context.Context, value types.List, p path.Path, diags *diag.Diagnostics, iteratee func(item T1, meta ListMeta) T2) []T2
ListTypeToSlice converts a types.List first into a tfsdk aware []T1 and transforms the result into a []T2.
func ListTypeToSlice_String ¶ added in v0.11.8
func ListTypeToSlice_String(ctx context.Context, value types.List, p path.Path, diags *diag.Diagnostics) []string
ListTypeToSlice_String converts a types.List into a []string. This is a shorthand ListTypeToSlice helper for strings.
func ListValueFrom ¶ added in v0.11.10
func ListValueFrom[T any](ctx context.Context, value []T, elemType attr.Type, p path.Path, diags *diag.Diagnostics) types.List
ListValueFrom converts a tfsdk aware []T to a types.List.
func MapRef ¶ added in v0.11.8
MapRef is similar to Pointer, 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 MapToMapType ¶ added in v0.11.12
func MapToMapType[T1 any, T2 any](ctx context.Context, value map[string]T1, elemType attr.Type, p path.Path, diags *diag.Diagnostics, iteratee func(item T1, meta MapMeta) T2) types.Map
MapToMapType converts a tfsdk naive map[string]T1 into an types.Map of map[string]T2. This handles both structs and simple types to attr.Values.
func MapToNormalizedType ¶ added in v0.11.8
func MapToNormalizedType[T any](value map[string]T, p path.Path, diags *diag.Diagnostics) jsontypes.Normalized
MapToNormalizedType marshals a map[string]T into a jsontypes.Normalized.
func MapTypeAs ¶ added in v0.11.12
func MapTypeAs[T any](ctx context.Context, value types.Map, p path.Path, diags *diag.Diagnostics) map[string]T
MapTypeAs converts a types.Map into a tfsdk aware map[string]T.
func MapTypeToMap ¶ added in v0.11.12
func MapTypeToMap[T1 any, T2 any](ctx context.Context, value types.Map, p path.Path, diags *diag.Diagnostics, iteratee func(item T1, meta MapMeta) T2) map[string]T2
MapTypeToMap converts a types.Map first into a tfsdk aware map[string]T1 and transforms the result into a map[string]T2.
func MapValueFrom ¶ added in v0.11.12
func MapValueFrom[T any](ctx context.Context, value map[string]T, elemType attr.Type, p path.Path, diags *diag.Diagnostics) types.Map
MapValueFrom converts a tfsdk aware map[string]T to a types.Map.
func MergeSchemaMaps ¶
func NewDebugTransport ¶ added in v0.6.2
func NewDebugTransport(name string, transport http.RoundTripper) *debugRoundTripper
func NormalizeIndexSettings ¶ added in v0.2.0
func NormalizedTypeToMap ¶ added in v0.11.8
func NormalizedTypeToMap[T any](value jsontypes.Normalized, p path.Path, diags *diag.Diagnostics) map[string]T
NormalizedTypeToMap unmarshals a jsontypes.Normalized to a map[string]T.
func ObjectTypeAs ¶ added in v0.11.12
func ObjectTypeAs[T any](ctx context.Context, value types.Object, p path.Path, diags *diag.Diagnostics) *T
ObjectTypeAs converts a types.Object into a tfsdk aware T.
func ObjectTypeToStruct ¶ added in v0.11.12
func ObjectTypeToStruct[T1 any, T2 any](ctx context.Context, value types.Object, p path.Path, diags *diag.Diagnostics, transformee func(item T1, meta ObjectMeta) T2) *T2
ObjectTypeToStruct converts a types.Object first into a tfsdk aware T1 and transforms the result into a T2.
func ObjectValueFrom ¶ added in v0.11.12
func ObjectValueFrom[T any](ctx context.Context, value *T, attrTypes map[string]attr.Type, p path.Path, diags *diag.Diagnostics) types.Object
ObjectValueFrom converts a tfsdk aware T to a types.Object.
func PrettyPrintJSONLines ¶ added in v0.6.0
PrettyPrintJSONLines iterates through a []byte line-by-line, transforming any lines that are complete json into pretty-printed json.
func SdkDiagsAsError ¶ added in v0.11.7
func SdkDiagsAsError(diags sdkdiag.Diagnostics) error
func SliceRef ¶ added in v0.11.8
func SliceRef[T any, S ~[]T](value S) *S
SliceRef is similar to Pointer, 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 SliceToListType ¶ added in v0.11.7
func SliceToListType[T1 any, T2 any](ctx context.Context, value []T1, elemType attr.Type, p path.Path, diags *diag.Diagnostics, iteratee func(item T1, meta ListMeta) T2) types.List
SliceToListType converts a tfsdk naive []T1 into an types.List of []T2. This handles both structs and simple types to attr.Values.
func SliceToListType_String ¶ added in v0.11.8
func SliceToListType_String(ctx context.Context, value []string, p path.Path, diags *diag.Diagnostics) types.List
SliceToListType_String converts a tfsdk naive []string into a types.List. This is a shorthand SliceToListType helper for strings.
func StringIsDuration ¶ added in v0.6.0
StringIsDuration is a SchemaValidateFunc which tests to make sure the supplied string is valid duration.
func StringIsElasticDuration ¶ added in v0.6.0
StringIsElasticDuration is a SchemaValidateFunc which tests to make sure the supplied string is valid duration using Elastic time units: d, h, m, s, ms, micros, nanos. (see https://www.elastic.co/guide/en/elasticsearch/reference/current/api-conventions.html#time-units)
func StringIsHours ¶ added in v0.11.7
StringIsHours is a SchemaValidateFunc which tests to make sure the supplied string is in the required format of HH:mm
func StringToHash ¶ added in v0.3.0
func StructToObjectType ¶ added in v0.11.12
func StructToObjectType[T1 any, T2 any](ctx context.Context, value *T1, attrTypes map[string]attr.Type, p path.Path, diags *diag.Diagnostics, transformee func(item T1, meta ObjectMeta) T2) types.Object
StructToObjectType converts a tfsdk naive T1 into an types.Object of T2.
func TestCheckResourceListAttr ¶ added in v0.4.0
func TestCheckResourceListAttr(name, key string, values []string) resource.TestCheckFunc
func TransformMap ¶ added in v0.11.12
func TransformMap[T1 any, T2 any](ctx context.Context, value map[string]T1, p path.Path, diags *diag.Diagnostics, iteratee func(item T1, meta MapMeta) T2) map[string]T2
TransformMap converts map[string]T1 to map[string]T2 via the iteratee.
func TransformMapToSlice ¶ added in v0.11.8
func TransformMapToSlice[T1 any, T2 any](ctx context.Context, value map[string]T1, p path.Path, diags *diag.Diagnostics, iteratee func(item T1, meta MapMeta) T2) []T2
TransformSliceToMap converts []T1 to map[string]]T2 via the iteratee.
func TransformObject ¶ added in v0.11.12
func TransformObject[T1 any, T2 any](ctx context.Context, value *T1, p path.Path, diags *diag.Diagnostics, transformee func(item T1, meta ObjectMeta) T2) *T2
TransformObject converts T1 to T2 via the transformee.
func TransformSlice ¶ added in v0.11.7
func TransformSlice[T1 any, T2 any](ctx context.Context, value []T1, p path.Path, diags *diag.Diagnostics, iteratee func(item T1, meta ListMeta) T2) []T2
TransformSlice converts []T1 to []T2 via the iteratee.
func TransformSliceToMap ¶ added in v0.11.8
func TransformSliceToMap[T1 any, T2 any](ctx context.Context, value []T1, p path.Path, diags *diag.Diagnostics, iteratee func(item T1, meta ListMeta) (key string, elem T2)) map[string]T2
TransformSliceToMap converts []T1 to map[string]]T2 via the iteratee.
func ValueStringPointer ¶ added in v0.11.12
ValueStringPointer returns nil if unknown, otherwise the same as value.ValueStringPointer(). Useful for computed optional fields without a default value, as these unknown values return a pointer to an empty string.