retryhttp

package
v0.0.0-...-355e69c Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: BSD-3-Clause Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultTimeout = time.Second * 30
	DefaultRetries = 5
	DefaultClient  = NewClient(DefaultTimeout, DefaultRetries)
)

Functions

This section is empty.

Types

type Client

type Client struct {
	*retryablehttp.Client
}

func NewClient

func NewClient(timeout time.Duration, retries int) *Client

func (*Client) Do

func (c *Client) Do(req *retryablehttp.Request) (*http.Response, error)

func (*Client) Get

func (c *Client) Get(url string) (*http.Response, error)

func (*Client) Head

func (c *Client) Head(url string) (*http.Response, error)

func (*Client) Post

func (c *Client) Post(url, bodyType string, body interface{}) (*http.Response, error)

func (*Client) PostForm

func (c *Client) PostForm(url string, data url.Values) (*http.Response, error)

func (*Client) StandardClient

func (c *Client) StandardClient() *http.Client

type Logger

type Logger interface {
	Printf(string, ...interface{})
}

type RoundTripper

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

RoundTripper implements the http.RoundTripper interface, using a retrying HTTP client to execute requests.

func (*RoundTripper) RoundTrip

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

RoundTrip satisfies the http.RoundTripper interface.

type UserNetworkError

type UserNetworkError struct {
	// contains filtered or unexported fields
}

func (*UserNetworkError) Error

func (e *UserNetworkError) Error() string

func (*UserNetworkError) ExitCode

func (e *UserNetworkError) ExitCode() int

Jump to

Keyboard shortcuts

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