Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
Get(url string, headers http.Header) (*http.Response, error)
Post(url string, body io.Reader, headers http.Header) (*http.Response, error)
PostForm(url string, val url.Values, headers http.Header) (*http.Response, error)
Put(url string, body io.Reader, headers http.Header) (*http.Response, error)
Patch(url string, body io.Reader, headers http.Header) (*http.Response, error)
Delete(url string, headers http.Header) (*http.Response, error)
Do(req *http.Request) (*http.Response, error)
Options() Options
Clone(opts ...Option) Client
}
Client http client interface
type Options ¶
type Options struct {
Retrier Retriable
Timeout time.Duration
RetryCount int
Middles []Middleware
Transport http.RoundTripper
}
Options represents the http client options
type RetriableFunc ¶
RetriableFunc is an adapter to allow the use of ordinary functions as a Retriable
func (RetriableFunc) NextInterval ¶
func (f RetriableFunc) NextInterval(retry int) time.Duration
NextInterval calls f(retry)
Click to show internal directories.
Click to hide internal directories.