Documentation ¶
Index ¶
- func Get(url string, opts ...RequestOption) (*http.Response, error)
- func MultiGet(urls []string, concurrency, wait int, opts ...RequestOption) ([]*http.Response, error)
- func NewRequest(method, url string, opts ...RequestOption) (*retryablehttp.Request, error)
- func POST(url string, opts ...RequestOption) (*http.Response, error)
- type Client
- func (c *Client) Do(req *retryablehttp.Request) (*http.Response, error)
- func (c *Client) Get(url string, opts ...RequestOption) (*http.Response, error)
- func (c *Client) MultiGet(urls []string, concurrency, wait int, opts ...RequestOption) ([]*http.Response, error)
- func (c *Client) POST(url string, opts ...RequestOption) (*http.Response, error)
- func (c *Client) PipelineDo(reqs []*retryablehttp.Request, concurrency, wait int, ...) error
- func (c *Client) PipelineGet(urls []string, concurrency, wait int, cont func(resp *http.Response) error, ...) error
- type ClientOption
- func WithClientBackoff(f retryablehttp.Backoff) ClientOption
- func WithClientCheckRetry(f retryablehttp.CheckRetry) ClientOption
- func WithClientHTTPClient(client *http.Client) ClientOption
- func WithClientLogger(log interface{}) ClientOption
- func WithClientRetryMax(retry int) ClientOption
- func WithClientRetryWaitMax(wait time.Duration) ClientOption
- func WithClientRetryWaitMin(wait time.Duration) ClientOption
- type RequestOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRequest ¶
func NewRequest(method, url string, opts ...RequestOption) (*retryablehttp.Request, error)
Types ¶
type Client ¶
type Client retryablehttp.Client
func NewClient ¶
func NewClient(opts ...ClientOption) *Client
func (*Client) PipelineDo ¶
func (*Client) PipelineGet ¶
type ClientOption ¶
type ClientOption interface {
// contains filtered or unexported methods
}
func WithClientBackoff ¶
func WithClientBackoff(f retryablehttp.Backoff) ClientOption
func WithClientCheckRetry ¶
func WithClientCheckRetry(f retryablehttp.CheckRetry) ClientOption
func WithClientHTTPClient ¶
func WithClientHTTPClient(client *http.Client) ClientOption
func WithClientLogger ¶
func WithClientLogger(log interface{}) ClientOption
func WithClientRetryMax ¶
func WithClientRetryMax(retry int) ClientOption
func WithClientRetryWaitMax ¶
func WithClientRetryWaitMax(wait time.Duration) ClientOption
func WithClientRetryWaitMin ¶
func WithClientRetryWaitMin(wait time.Duration) ClientOption
type RequestOption ¶
type RequestOption interface {
// contains filtered or unexported methods
}
func WithRequestBody ¶
func WithRequestBody(body []byte) RequestOption
func WithRequestHeader ¶
func WithRequestHeader(h http.Header) RequestOption
Click to show internal directories.
Click to hide internal directories.