util

package
v0.0.0-...-dfd9850 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WaitUntil

func WaitUntil(waitFor string, f CheckFunc, opts ...WaitOption) error

WaitUntil repeatedly evaluates f() for a period of time, util it returns true.

func WrapErrors

func WrapErrors(errs []error) error

WrapErrors wrap errors into error

Types

type CheckFunc

type CheckFunc func() bool

CheckFunc is a condition checker that passed to WaitUntil. Its implementation may call c.Fatal() to abort the test, or c.Log() to add more information.

type WaitOp

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

WaitOp represents available options when execute WaitUntil

type WaitOption

type WaitOption func(op *WaitOp)

WaitOption configures WaitOp

func WithRetryTimes

func WithRetryTimes(retryTimes int) WaitOption

WithRetryTimes specify the retry times

func WithSleepInterval

func WithSleepInterval(sleep time.Duration) WaitOption

WithSleepInterval specify the sleep duration

Jump to

Keyboard shortcuts

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