utils

package
v0.5.10 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrQueueEmpty = fmt.Errorf("QUEUE EMPTY")
)

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 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 Append

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

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 ContainsEitherSubstring

func ContainsEitherSubstring(slice []string, elements []string) bool

func FromListValueToStringList

func FromListValueToStringList(tl types.List) []string

func FromSetValueToStringList

func FromSetValueToStringList(tl types.Set) []string

func GetCdpClientForResource

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

func GetMapFromSingleItemList

func GetMapFromSingleItemList(d *schema.ResourceData, name string) (map[string]interface{}, error)

func GetMapFromSingleItemListInMap

func GetMapFromSingleItemListInMap(d map[string]interface{}, name string) (map[string]interface{}, error)

func Int64To32Pointer added in v0.5.7

func Int64To32Pointer(in types.Int64) *int32

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)

func ReadFileContent

func ReadFileContent(ctx context.Context, path string) (*string, error)

func ToBaseTypesStringMap

func ToBaseTypesStringMap(in map[string]string) map[string]types.String

func ToStringList

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

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 EnvironmentErrorPayload

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

type IamErrorPayload added in v0.5.9

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

type PollingOptions

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

type Queue

type Queue[T any] interface {
	Enqueue(T) error
	Dequeue() (T, error)
	Len() int
}

func NewSliceQueue

func NewSliceQueue[T any]() Queue[T]

type SliceQueue

type SliceQueue[T any] []T

func (*SliceQueue[T]) Dequeue

func (q *SliceQueue[T]) Dequeue() (T, error)

func (*SliceQueue[T]) Enqueue

func (q *SliceQueue[T]) Enqueue(value T) error

func (*SliceQueue[T]) Len

func (q *SliceQueue[T]) Len() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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