retry

package
v1.116.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: Unlicense Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidStatusCode = errors.New("invalid status code")

ErrInvalidStatusCode for http retry.

Functions

This section is empty.

Types

type Config

type Config struct {
	Timeout  time.Duration `yaml:"timeout" json:"timeout" toml:"timeout"`
	Attempts uint          `yaml:"attempts" json:"attempts" toml:"attempts"`
}

Config for retry.

type RoundTripper

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

RoundTripper for retry.

func NewRoundTripper

func NewRoundTripper(cfg *Config, hrt http.RoundTripper) *RoundTripper

NewRoundTripper for retry.

func (*RoundTripper) RoundTrip

func (r *RoundTripper) RoundTrip(req *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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