Versions in this module Expand all Collapse all v1 v1.0.2 Mar 19, 2021 Changes in this version + func DefaultBackoff(min, max time.Duration, attemptNum int, resp *http.Response) time.Duration + func DefaultRetryPolicy(ctx context.Context, resp *http.Response, err error) (bool, error) + func ErrorPropagatedRetryPolicy(ctx context.Context, resp *http.Response, err error) (bool, error) + func Get(url string) (*http.Response, error) + func Head(url string) (*http.Response, error) + func LinearJitterBackoff(min, max time.Duration, attemptNum int, resp *http.Response) time.Duration + 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 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 + Logger interface{} + RequestLogHook RequestLogHook + ResponseLogHook ResponseLogHook + RetryMax int + RetryWaitMax time.Duration + RetryWaitMin time.Duration + func NewClient() *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) + func (c *Client) StandardClient() *http.Client + type ErrorHandler func(resp *http.Response, err error, numTries int) (*http.Response, error) + type LenReader interface + Len func() int + type LeveledLogger interface + Debug func(msg string, keysAndValues ...interface{}) + Error func(msg string, keysAndValues ...interface{}) + Info func(msg string, keysAndValues ...interface{}) + Warn func(msg string, keysAndValues ...interface{}) + type Logger interface + Printf func(string, ...interface{}) + type ReaderFunc func() (io.Reader, error) + type Request struct + func FromRequest(r *http.Request) (*Request, error) + func NewRequest(method, url string, rawBody interface{}) (*Request, error) + func (r *Request) BodyBytes() ([]byte, error) + func (r *Request) SetBody(rawBody interface{}) error + func (r *Request) WithContext(ctx context.Context) *Request + func (r *Request) WriteTo(w io.Writer) (int64, error) + type RequestLogHook func(Logger, *http.Request, int) + type ResponseLogHook func(Logger, *http.Response) + type RoundTripper struct + Client *Client + func (rt *RoundTripper) RoundTrip(req *http.Request) (*http.Response, error)