backoff

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2025 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoBackoff PoliticType = iota
	ExponentialBackoff
	ConstantBackoff

	DefaultRetries                = 1
	DefaultMaxInterval            = 60 * time.Second
	DefaultExponentialMultiplayer = 2
	DefaultDelay                  = 250 * time.Millisecond
)

Variables

This section is empty.

Functions

func SetupClientBackoff

func SetupClientBackoff(client *http.Client, delay time.Duration, retries int, backoff PoliticType)

Types

type HTTPTransport

type HTTPTransport struct {
	http.RoundTripper
	// contains filtered or unexported fields
}

func NewTransport

func NewTransport(delay time.Duration, retries int, backoff PoliticType, tripper http.RoundTripper) *HTTPTransport

func (*HTTPTransport) RoundTrip

func (s *HTTPTransport) RoundTrip(req *http.Request) (resp *http.Response, err error)

type PoliticType

type PoliticType int

Jump to

Keyboard shortcuts

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