retry

package
v0.0.0-...-619fe92 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultBackoff

func DefaultBackoff(times, maxTimes int, retryWaitMin, retryWaitMax time.Duration) time.Duration

func ExponentialBackoff

func ExponentialBackoff(times, maxTimes int, retryWaitMin, retryWaitMax time.Duration) time.Duration

func LinearJitterBackoff

func LinearJitterBackoff(times, maxTimes int, retryWaitMin, retryWaitMax time.Duration) time.Duration

func New

func New(opts ...Option) middleware.Middleware

Types

type BackoffPolicy

type BackoffPolicy func(times, maxTimes int, retryWaitMin, retryWaitMax time.Duration) time.Duration

type Checker

type Checker func(ctx context.Context, resp *http.Response, err error) (bool, error)

type Option

type Option func(*options)

func WithBackoffPolicy

func WithBackoffPolicy(policy BackoffPolicy) Option

func WithChecker

func WithChecker(checker Checker) Option

func WithLogger

func WithLogger(logger log.Logger) Option

func WithMaxTimes

func WithMaxTimes(maxTimes int) Option

func WithWaitMax

func WithWaitMax(wait time.Duration) Option

func WithWaitMin

func WithWaitMin(wait time.Duration) Option

Jump to

Keyboard shortcuts

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