retry

package
v0.18.3 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WaitLabelFromContext added in v0.18.3

func WaitLabelFromContext(ctx context.Context) (string, bool)

WaitLabelFromContext returns the retry-wait attribution label, if present.

func WithWaitLabel added in v0.18.3

func WithWaitLabel(ctx context.Context, label string) context.Context

WithWaitLabel attaches a bounded attribution label to retry waits.

Types

type RetryConfig

type RetryConfig struct {
	MaxAttempts  uint          // 0 means no limit (which is also the default).
	InitialDelay time.Duration // Default is 1 second.
	MaxDelay     time.Duration // Default is 60 seconds. 0 means no limit.
	OnWait       func(ctx context.Context, wait time.Duration, rateLimited bool)
}

type Retryer

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

func NewRetryer

func NewRetryer(ctx context.Context, config RetryConfig) *Retryer

func (*Retryer) ShouldWaitAndRetry

func (r *Retryer) ShouldWaitAndRetry(ctx context.Context, err error) bool

Jump to

Keyboard shortcuts

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