Versions in this module Expand all Collapse all v1 v1.2.0 Feb 9, 2022 v1.1.0 Mar 31, 2020 Changes in this version + var DefaultClient = &Client + var ErrReadingBody = errors.New("error reading body") + var ErrReadingRequestBody = errors.New("error reading request body") + var ErrUnexpectedMethod = errors.New("unexpected client method, must be one of Do, Get, Head, Post, or PostFrom") + func DefaultBackoff(_ int) time.Duration + func Do(req *http.Request) (resp *http.Response, err error) + func ExponentialBackoff(i int) time.Duration + func ExponentialJitterBackoff(i int) time.Duration + func Get(url string) (resp *http.Response, err error) + func Head(url string) (resp *http.Response, err error) + func LinearBackoff(i int) time.Duration + func LinearJitterBackoff(i int) time.Duration + func Post(url string, bodyType string, body io.Reader) (resp *http.Response, err error) + func PostForm(url string, data url.Values) (resp *http.Response, err error) + type BackoffStrategy func(retry int) time.Duration + type Client struct + Backoff BackoffStrategy + CheckRedirect func(req *http.Request, via []*http.Request) error + Concurrency int + ContextLogHook ContextLogHook + ErrLog []ErrEntry + Jar http.CookieJar + KeepLog bool + LogHook LogHook + MaxRetries int + RetryOnHTTP429 bool + SuccessReqNum int + SuccessRetryNum int + Timeout time.Duration + Transport http.RoundTripper + func New() *Client + func NewExtendedClient(hc *http.Client) *Client + func (c *Client) Do(req *http.Request) (resp *http.Response, err error) + func (c *Client) EmbedHTTPClient(hc *http.Client) + func (c *Client) FormatError(e ErrEntry) string + func (c *Client) Get(url string) (resp *http.Response, err error) + func (c *Client) Head(url string) (resp *http.Response, err error) + func (c *Client) LogErrCount() int + func (c *Client) LogString() string + func (c *Client) Post(url string, bodyType string, body io.Reader) (resp *http.Response, err error) + func (c *Client) PostForm(url string, data url.Values) (resp *http.Response, err error) + func (c *Client) SetRetryOnHTTP429(flag bool) + func (c *Client) Wait() + type ContextLogHook func(ctx context.Context, e ErrEntry) + type ErrEntry struct + Attempt int + Err error + Method string + Request int + Retry int + Time time.Time + URL string + Verb string + type LogHook func(e ErrEntry)