retry

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: LGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UntilNoError

func UntilNoError(ctx context.Context, retryWait time.Duration,
	f func() (err error)) (err error)

UntilNoError retries the function `f` until it returns a nil error. It waits `retryWait` after each failed call to `f`. If the context `ctx` is canceled, the function returns immediately an error stating the number of failed tries, for how long it retried and the last error returned by `f`.

func UntilOK

func UntilOK(ctx context.Context, retryWait time.Duration,
	f func() (ok bool, err error)) (err error)

UntilOK retries the function `f` until it returns a true value for `ok` or a non nil error. It waits `retryWait` after each failed call to `f`. If the context `ctx` is canceled, the function returns immediately an error stating the number of failed tries, for how long it retried and the context error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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