retry

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package retry provides a mechanism to execute a function with retry logic.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(ctx context.Context, maxDuration time.Duration, fn func() error, matches ...string) error

Do implements retry using fibonacci backoff, up to a total execution time of maxDuration. The retry impl is mostly handled by the sethvargo/go-retry package. The matched args are tested against the error returned by fn; if the error message contains any of matches, retry can be performed.

err = retry.Do(ctx, time.Second*5, loadDataFn, "not found", "timeout")

Types

This section is empty.

Jump to

Keyboard shortcuts

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