ret

package
v1.2.14 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: MIT Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RetryForError

func RetryForError(ctx context.Context, do func() error, shouldRetry func(error) time.Duration, retries int, logger log.Logger) error

RetryForError call do() and retry max `retries` count if do() returns a error, and shouldRetry(err) returns a duration. returns the error if do() returns a non retryable error.

Types

type Retryer added in v1.2.14

type Retryer struct {
	Logger      log.Logger
	MaxRetries  int
	ShouldRetry func(error) time.Duration
}

func (*Retryer) Do added in v1.2.14

func (r *Retryer) Do(ctx context.Context, do func() error) error

Jump to

Keyboard shortcuts

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