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

retrypolicy

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMiddleware

func NewMiddleware[I, O any](shouldRetry func(error) bool, opts ...Option) ocrs.Middleware[I, O]

Types

type Config

type Config struct {
	MaxAttempts    int
	InitialBackoff time.Duration
	MaxBackoff     time.Duration
	Multiplier     float64
}

func DefaultConfig

func DefaultConfig() Config

func New

func New(opts ...Option) Config

type Option

type Option func(*Config)

func WithInitialBackoff

func WithInitialBackoff(d time.Duration) Option

func WithMaxBackoff

func WithMaxBackoff(d time.Duration) Option

func WithMaxTry

func WithMaxTry(n int) Option

func WithMultiplier

func WithMultiplier(m float64) Option

Jump to

Keyboard shortcuts

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