httputil

package
v0.0.0-...-ae37617 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRetry = errors.New("retry")

Functions

func IsErrRetry

func IsErrRetry(err error) bool

func NewErrRetry

func NewErrRetry(reason string) error

func NewRetriableHTTPClient

func NewRetriableHTTPClient(opts ...RetriableHTTPOption) *retryablehttp.Client

func RetryPolicy

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

Types

type RetriableHTTPOption

type RetriableHTTPOption func(*retriableHTTPOptions)

func WithBackoff

func WithBackoff(backoff retryablehttp.Backoff) RetriableHTTPOption

func WithCaCert

func WithCaCert(caCert string) RetriableHTTPOption

func WithCheckRetry

func WithCheckRetry(checkRetry retryablehttp.CheckRetry) RetriableHTTPOption

func WithDialTimeout

func WithDialTimeout(timeout time.Duration) RetriableHTTPOption

func WithDialer

func WithDialer(dialer func(ctx context.Context, network, addr string) (net.Conn, error)) RetriableHTTPOption

func WithExpectContinueTimeout

func WithExpectContinueTimeout(timeout time.Duration) RetriableHTTPOption

func WithIdleConnTimeout

func WithIdleConnTimeout(timeout time.Duration) RetriableHTTPOption

func WithKeepAlive

func WithKeepAlive(timeout time.Duration) RetriableHTTPOption

func WithMaxIdleConns

func WithMaxIdleConns(count int) RetriableHTTPOption

func WithMaxRetryCount

func WithMaxRetryCount(count int) RetriableHTTPOption

func WithMaxRetryWait

func WithMaxRetryWait(max time.Duration) RetriableHTTPOption

func WithMinRetryWait

func WithMinRetryWait(min time.Duration) RetriableHTTPOption

func WithProxy

func WithProxy(proxy func(req *http.Request) (*url.URL, error)) RetriableHTTPOption

func WithTLSHandShakeTimeout

func WithTLSHandShakeTimeout(timeout time.Duration) RetriableHTTPOption

func WithTLSInsecureSkipVerify

func WithTLSInsecureSkipVerify() RetriableHTTPOption

Jump to

Keyboard shortcuts

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