Help us shape the future of Go! Take the 2026 Go Developer Survey

retrier

package
v0.85.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action int
const (
	Succeed         Action = iota // Succeed indicates the Retrier should treat this value as a success.
	Fail                          // Fail indicates the Retrier should treat this value as a hard failure and not retry.
	Retry                         // Retry indicates the Retrier should treat this value as a soft failure and retry.
	AdditionalCheck               // Additional check is required to determine if it's Fail or Retry
)

type AdditionalTest

type AdditionalTest interface {
	IsHardFailure(context.Context) (bool, error)
}

type Retrier

type Retrier struct {
	// contains filtered or unexported fields
}

func NewRetrier

func NewRetrier(maxRetries int, initialBackoff time.Duration, additionalTest AdditionalTest) *Retrier

func (*Retrier) RunCtx

func (r *Retrier) RunCtx(ctx context.Context, work func(ctx context.Context) (driver.Rows, Action, error)) (driver.Rows, error)

Jump to

Keyboard shortcuts

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