utils

package
v0.0.0-...-221c3f5 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIfPathExist

func CheckIfPathExist(path string) bool

func ConnectionChecker

func ConnectionChecker(url string) error

func DecryptValue

func DecryptValue(encryptedValue string) (string, error)

func Getenv

func Getenv(key string) string

func ReadYAML

func ReadYAML(path string, result interface{}) error

func Retry

func Retry(f func() error, operationName string, config RetryConfig) error

Types

type RetryConfig

type RetryConfig struct {
	MaxRetries        int           // Maximum number of retry attempts (-1 for unlimited)
	InitialBackoff    time.Duration // Initial wait time before the first retry attempt
	MaxBackoff        time.Duration // Maximum wait time between retry attempts (upper limit for exponential backoff)
	BackoffMultiplier float64       // Growth factor for exponential backoff (0 = fixed wait, >1 = exponential growth)
	LogInterval       int           // Log every N attempts (0 = log only once, >0 = log periodically)
	ErrorFilter       []string      // List of error message substrings to match for retry (nil = retry all errors)
	StopOnMismatch    bool          // If true, return error when it doesn't match ErrorFilter; if false, continue without retrying
}

func ConnectionRetryConfig

func ConnectionRetryConfig() RetryConfig

func DefaultRetryConfig

func DefaultRetryConfig() RetryConfig

Jump to

Keyboard shortcuts

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