utils

package
v0.74.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyDirectory

func CopyDirectory(source string, dest string) error

CopyDirectory copy the entire directory to another destination

func Retry added in v0.18.0

func Retry(attempts int, sleep time.Duration, f func() error) error

Retry is retrying a function for a maximum number of attempts and time

func SanitizeAlphaNumericString added in v0.68.1

func SanitizeAlphaNumericString(input string) string

SanitizeAlphaNumericString converts a string to a valid AlphaNumeric representation, converting all letters to lowercase and then removing all invalid characters.

Types

type Backoff added in v0.69.0

type Backoff struct {
	// contains filtered or unexported fields
}

Backoff holds exponential backoff settings

func NewExponentialBackoff added in v0.69.0

func NewExponentialBackoff(initialInterval, maxInterval, maxElapsedTime time.Duration) *Backoff

NewExponentialBackoff is used to retry a function with exponential backoff

func (*Backoff) Retry added in v0.69.0

func (b *Backoff) Retry(fn backoff.Operation) error

Retry is used to invoke a function with constant backoff

type DBClusterUtilizationSettings added in v0.58.0

type DBClusterUtilizationSettings struct {
	MaxInstallationsPerseus              int
	MaxInstallationsRDSPostgresPGBouncer int
	MaxInstallationsRDSPostgres          int
	MaxInstallationsRDSMySQL             int
}

DBClusterUtilizationSettings define maximum utilization of database clusters.

type ResourceUtil added in v0.17.0

type ResourceUtil struct {
	// contains filtered or unexported fields
}

ResourceUtil is used for calling any filestore type.

func NewResourceUtil added in v0.17.0

func NewResourceUtil(
	instanceID string,
	awsClient *aws.Client,
	dbClusterUtilization DBClusterUtilizationSettings,
	disableDBCheck bool,
	enableS3Versioning bool) *ResourceUtil

NewResourceUtil returns a new instance of ResourceUtil.

func (*ResourceUtil) GetDatabase added in v0.17.0

func (r *ResourceUtil) GetDatabase(installationID, dbType string) model.Database

GetDatabase returns the Database interface that matches the installationID and DB type.

func (*ResourceUtil) GetDatabaseForInstallation added in v0.45.0

func (r *ResourceUtil) GetDatabaseForInstallation(installation *model.Installation) model.Database

GetDatabaseForInstallation returns the Database interface that matches the installation.

func (*ResourceUtil) GetFilestore added in v0.17.0

func (r *ResourceUtil) GetFilestore(installation *model.Installation) model.Filestore

GetFilestore returns the Filestore interface that matches the installation.

Jump to

Keyboard shortcuts

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