utils

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NonRetryableErrorCodes = [...]int{403}

Functions

func AddDatabaseDiagnosticsError added in v0.5.7

func AddDatabaseDiagnosticsError(err error, diagnostics *diag.Diagnostics, errMsg string)

func AddDatahubDiagnosticsError

func AddDatahubDiagnosticsError(err error, diagnostics *diag.Diagnostics, errMsg string)

func AddDatalakeDiagnosticsError

func AddDatalakeDiagnosticsError(err error, diagnostics *diag.Diagnostics, errMsg string)

func AddDeDiagnosticsError added in v0.6.1

func AddDeDiagnosticsError(err error, diagnostics *diag.Diagnostics, errMsg string)

func AddEnvironmentDiagnosticsError

func AddEnvironmentDiagnosticsError(err error, diagnostics *diag.Diagnostics, errMsg string)

func AddIamDiagnosticsError added in v0.5.9

func AddIamDiagnosticsError(err error, diagnostics *diag.Diagnostics, errMsg string)

func AddMlDiagnosticsError added in v0.6.0

func AddMlDiagnosticsError(err error, diagnostics *diag.Diagnostics, errMsg string)

func Append

func Append(to map[string]schema.Attribute, from map[string]schema.Attribute)

func CalculateCallFailureThresholdOrDefault added in v0.6.1

func CalculateCallFailureThresholdOrDefault(ctx context.Context, options *PollingOptions, fallback int) (int, error)

func CalculateTimeoutOrDefault

func CalculateTimeoutOrDefault(ctx context.Context, options *PollingOptions, fallback time.Duration) (*time.Duration, error)

func CheckStringEquals added in v0.4.0

func CheckStringEquals(name string, expected string, actual string) error

CheckStringEquals checks whether two strings are equal and returns nil if so, and an error otherwise.

func Concat added in v0.4.0

func Concat(strs ...string) string

Concat concatenates input strings

func ContainsAsSubstring

func ContainsAsSubstring(slice []string, element string) bool

func FromListValueToStringList

func FromListValueToStringList(tl types.List) []string

func FromMapValueToStringMap added in v0.6.1

func FromMapValueToStringMap(tl types.Map) map[string]string

func FromSetValueToStringList

func FromSetValueToStringList(tl types.Set) []string

func GetCallFailureThreshold added in v0.7.3

func GetCallFailureThreshold[T HasPollingOptions](p T, fallback int) int

GetCallFailureThreshold returns the call failure threshold from the given polling options or the fallback value. In case a negative value is given, it will be treated as zero.

func GetCdpClientForResource

func GetCdpClientForResource(req resource.ConfigureRequest, resp *resource.ConfigureResponse) *cdp.Client

func GetPollingTimeout added in v0.7.3

func GetPollingTimeout[T HasPollingOptions](p T, fallback time.Duration) time.Duration

GetPollingTimeout returns the polling timeout from the given polling options or the fallback value. In case a negative value is given, it will be treated as one minute.

func Int64To32Pointer added in v0.5.7

func Int64To32Pointer(in types.Int64) *int32

func IsNonRetryableError added in v0.6.3

func IsNonRetryableError(code int) bool

func IsRetryableError added in v0.6.3

func IsRetryableError(code int) bool

func LogEnvironmentSilently

func LogEnvironmentSilently(ctx context.Context, content *environmentsmodels.Environment, messagePrefix string) *environmentsmodels.Environment

func LogSilently

func LogSilently(ctx context.Context, messagePrefix string, in any)

Types

type DatabaseErrorPayload added in v0.5.7

type DatabaseErrorPayload interface {
	GetPayload() *opdbmodels.Error
}

type DatahubErrorPayload

type DatahubErrorPayload interface {
	GetPayload() *datahubmodels.Error
}

type DatalakeErrorPayload

type DatalakeErrorPayload interface {
	GetPayload() *datalakemodels.Error
}

type DeErrorPayload added in v0.6.1

type DeErrorPayload interface {
	GetPayload() *demodels.Error
}

type EnvironmentErrorPayload

type EnvironmentErrorPayload interface {
	GetPayload() *environmentsmodels.Error
}

type HasPollingOptions added in v0.7.3

type HasPollingOptions interface {
	GetPollingOptions() *PollingOptions
}

type IamErrorPayload added in v0.5.9

type IamErrorPayload interface {
	GetPayload() *iammodels.Error
}

type MlErrorPayload added in v0.6.0

type MlErrorPayload interface {
	GetPayload() *mlmodels.Error
}

type PollingOptions

type PollingOptions struct {
	Async                types.Bool  `tfsdk:"async"`
	PollingTimeout       types.Int64 `tfsdk:"polling_timeout"`
	CallFailureThreshold types.Int64 `tfsdk:"call_failure_threshold"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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