Versions in this module Expand all Collapse all v1 v1.0.2 Jul 12, 2023 Changes in this version + var DefaultOptionsSingle = Options + var DefaultOptionsSpraying = Options + var PreferHTTP bool + func CheckRecoverableErrors(ctx context.Context, resp *http.Response, err error) (bool, error) + func DefaultBackoff() ... + func DefaultClient() *http.Client + func DefaultHostSprayingTransport() *http.Transport + func DefaultPooledClient() *http.Client + func DefaultRetryPolicy() func(ctx context.Context, resp *http.Response, err error) (bool, error) + func DefaultReusePooledTransport() *http.Transport + func Discard(req *Request, resp *http.Response, RespReadLimit int64) + func ExponentialJitterBackoff() ... + func FullJitterBackoff() ... + func Get(url string) (*http.Response, error) + func Head(url string) (*http.Response, error) + func HostSprayRetryPolicy() func(ctx context.Context, resp *http.Response, err error) (bool, error) + func LinearJitterBackoff() ... + func PassthroughErrorHandler(resp *http.Response, err error, _ int) (*http.Response, error) + func Post(url, bodyType string, body interface{}) (*http.Response, error) + func PostForm(url string, data url.Values) (*http.Response, error) + type Auth struct + Password string + Type AuthType + Username string + type AuthType uint8 + const DigestAuth + type Backoff func(min, max time.Duration, attemptNum int, resp *http.Response) time.Duration + type CheckRetry func(ctx context.Context, resp *http.Response, err error) (bool, error) + type Client struct + Backoff Backoff + CheckRetry CheckRetry + ErrorHandler ErrorHandler + HTTPClient *http.Client + HTTPClient2 *http.Client + RequestLogHook RequestLogHook + ResponseLogHook ResponseLogHook + var DefaultHTTPClient *Client + func NewClient(options Options) *Client + func NewWithHTTPClient(client *http.Client, options Options) *Client + func (c *Client) Do(req *Request) (*http.Response, error) + func (c *Client) Get(url string) (*http.Response, error) + func (c *Client) Head(url string) (*http.Response, error) + func (c *Client) Post(url, bodyType string, body interface{}) (*http.Response, error) + func (c *Client) PostForm(url string, data url.Values) (*http.Response, error) + type ContextOverride string + const RETRY_MAX + type ErrorHandler func(resp *http.Response, err error, numTries int) (*http.Response, error) + type Metrics struct + DrainErrors int + Failures int + Retries int + type Options struct + Backoff Backoff + CheckRetry CheckRetry + HttpClient *http.Client + KillIdleConn bool + NoAdjustTimeout bool + RespReadLimit int64 + RetryMax int + RetryWaitMax time.Duration + RetryWaitMin time.Duration + Timeout time.Duration + Verbose bool + type Request struct + Auth *Auth + Metrics Metrics + func FromRequest(r *http.Request) (*Request, error) + func FromRequestWithTrace(r *http.Request) (*Request, error) + func NewRequest(method, url string, body interface{}) (*Request, error) + func NewRequestFromURL(method string, urlx *urlutil.URL, body interface{}) (*Request, error) + func NewRequestFromURLWithContext(ctx context.Context, method string, urlx *urlutil.URL, body interface{}) (*Request, error) + func NewRequestWithContext(ctx context.Context, method, url string, body interface{}) (*Request, error) + func (r *Request) BodyBytes() ([]byte, error) + func (r *Request) Clone(ctx context.Context) *Request + func (r *Request) Dump() ([]byte, error) + func (r *Request) SetURL(u *urlutil.URL) + func (r *Request) Update() + func (r *Request) WithContext(ctx context.Context) *Request + type RequestLogHook func(*http.Request, int) + type ResponseLogHook func(*http.Response)