retrytransport

package
v0.0.0-...-da53dd4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsRetryableError

func IsRetryableError(err error, resp *http.Response) bool

Types

type RetryHTTPTransport

type RetryHTTPTransport struct {
	RoundTripper http.RoundTripper
	RetryOptions RetryOptions
	Logger       *zap.Logger
}

func NewRetryHTTPTransport

func NewRetryHTTPTransport(roundTripper http.RoundTripper, retryOptions RetryOptions, logger *zap.Logger) *RetryHTTPTransport

func (*RetryHTTPTransport) RoundTrip

func (rt *RetryHTTPTransport) RoundTrip(req *http.Request) (*http.Response, error)

type RetryOptions

type RetryOptions struct {
	Enabled       bool
	MaxRetryCount int
	Interval      time.Duration
	MaxDuration   time.Duration
	OnRetry       func(count int, req *http.Request, resp *http.Response, err error)
	ShouldRetry   ShouldRetryFunc
}

type ShouldRetryFunc

type ShouldRetryFunc func(err error, req *http.Request, resp *http.Response) bool

Jump to

Keyboard shortcuts

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