util

package
v0.11.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DurationMinutes = "minutes"
	DurationSeconds = "seconds"
)

Variables

View Source
var (
	DefaultRetry = wait.Backoff{
		Steps:    6,
		Duration: 1000 * time.Millisecond,
		Factor:   1.0,
		Jitter:   0.1,
	}
)

Functions

func DeleteEmpty

func DeleteEmpty(s []string) []string

func GetExpBackoff added in v0.10.1

func GetExpBackoff(steps int) wait.Backoff

func IsRetriable

func IsRetriable(err error) bool

func PathToOSFile

func PathToOSFile(relativePath string) (*os.File, error)

func RetryOnAnyError

func RetryOnAnyError(backoff *wait.Backoff, fn FuncToRetry) error

func RetryOnError

func RetryOnError(backoff *wait.Backoff, retryExpected func(error) bool, fn FuncToRetryWithReturn) (interface{}, error)

func StructToPrettyString added in v0.10.1

func StructToPrettyString(st interface{}) string

Types

type FuncToRetry

type FuncToRetry func() error

type FuncToRetryWithReturn

type FuncToRetryWithReturn func() (interface{}, error)

Jump to

Keyboard shortcuts

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