utils

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DepthQueryParam = int32(1)

DepthQueryParam is used in GET requests in Cloud API

Variables

This section is empty.

Functions

func ContainsStringInSlice

func ContainsStringInSlice(input []string, specific string) bool

ContainsStringInSlice will return true if the slice contains string

func ContainsStringSlices

func ContainsStringSlices(first, second []string) bool

ContainsStringSlices will return true if the slices have the same length and the same elements, even if they are located at different indexes.

func DereferenceOrZero added in v1.0.9

func DereferenceOrZero[T any](v *T) T

DereferenceOrZero returns the value of a pointer or a zero value if the pointer is nil.

func IsEmptyValue

func IsEmptyValue(v reflect.Value) bool

IsEmptyValue checks if a value is empty or not. nolint

func IsEqStringMaps

func IsEqStringMaps(first, second map[string]string) bool

IsEqStringMaps will return true if the maps are equal

func IsEqStringSlices

func IsEqStringSlices(first, second []string) bool

IsEqStringSlices will return true if the slices are equal (having the same length, and the same value at the same index)

func IsStringInSlice

func IsStringInSlice(input []string, specific string) bool

IsStringInSlice will return true if the slice contains the specific string

func MapStringToAny added in v1.0.9

func MapStringToAny(sMap map[string]string) map[string]any

MapStringToAny converts map[string]string to map[string]any

func NewTestLogger

func NewTestLogger() logging.Logger

NewTestLogger returns a logger used in unit tests.

func WaitForResourceToBeDeleted added in v1.0.9

func WaitForResourceToBeDeleted(ctx context.Context, timeoutInMinutes time.Duration, fn IsResourceDeletedFunc, ids ...string) error

WaitForResourceToBeDeleted - keeps retrying until resource is not found(404), or until ctx is cancelled

Types

type ConfigurationOptions

type ConfigurationOptions struct {
	PollInterval         time.Duration
	CreationGracePeriod  time.Duration
	Timeout              time.Duration
	IsUniqueNamesEnabled bool
}

ConfigurationOptions are options used in setting the provider and the controllers of the provider.

func NewConfigurationOptions

func NewConfigurationOptions(poll, createGracePeriod, timeout time.Duration, uniqueNamesEnable bool) *ConfigurationOptions

NewConfigurationOptions sets fields for ConfigurationOptions and return a new ConfigurationOptions

func (*ConfigurationOptions) GetCreationGracePeriod

func (o *ConfigurationOptions) GetCreationGracePeriod() time.Duration

GetCreationGracePeriod returns the value for the CreationGracePeriod option

func (*ConfigurationOptions) GetIsUniqueNamesEnabled

func (o *ConfigurationOptions) GetIsUniqueNamesEnabled() bool

GetIsUniqueNamesEnabled returns the value for the IsUniqueNamesEnabled option

func (*ConfigurationOptions) GetPollInterval

func (o *ConfigurationOptions) GetPollInterval() time.Duration

GetPollInterval returns the value for the PollInterval option

func (*ConfigurationOptions) GetTimeout

func (o *ConfigurationOptions) GetTimeout() time.Duration

GetTimeout returns the value for the Timeout option

type IsResourceDeletedFunc added in v1.0.9

type IsResourceDeletedFunc func(ctx context.Context, ids ...string) (bool, error)

IsResourceDeletedFunc polls api to see if resource exists based on id

Jump to

Keyboard shortcuts

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