try

package
v0.21.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrTooManyRetries indicates that an operation did not complete within
	// configured retry count.
	ErrTooManyRetries = fmt.Errorf("too many retries")
)

Functions

func Do

func Do(ctx context.Context, tracer tracing.Tracer, max int, f func(context.Context, int) (bool, error)) error

Do tries the function f until max attempts is reached. If f returns a true bool or a nil error retries are stopped and the error is returned.

Context cancellation is respected in between attempts.

Types

This section is empty.

Jump to

Keyboard shortcuts

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