istio: istio.io/istio/pkg/test/util/retry Index | Files

package retry

import "istio.io/istio/pkg/test/util/retry"

Index

Package Files

retry.go

Constants

const (
    // DefaultTimeout the default timeout for the entire retry operation
    DefaultTimeout = time.Second * 30

    // DefaultDelay the default delay between successive retry attempts
    DefaultDelay = time.Millisecond * 10
)

func Do Uses

func Do(fn RetriableFunc, options ...Option) (interface{}, error)

Do retries the given function, until there is a timeout, or until the function indicates that it has completed.

func UntilSuccess Uses

func UntilSuccess(fn func() error, options ...Option) error

UntilSuccess retries the given function until success, timeout, or until the passed-in function returns nil.

func UntilSuccessOrFail Uses

func UntilSuccessOrFail(t test.Failer, fn func() error, options ...Option)

UntilSuccessOrFail calls UntilSuccess, and fails t with Fatalf if it ends up returning an error

type Option Uses

type Option func(cfg *config)

Option for a retry opteration.

func Delay Uses

func Delay(delay time.Duration) Option

Delay sets the delay between successive retry attempts.

func Timeout Uses

func Timeout(timeout time.Duration) Option

Timeout sets the timeout for the entire retry operation.

type RetriableFunc Uses

type RetriableFunc func() (result interface{}, completed bool, err error)

RetriableFunc a function that can be retried.

Package retry imports 3 packages (graph) and is imported by 19 packages. Updated 2019-06-12. Refresh now. Tools for package owners.