http

package
v0.0.0-...-d070639 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(url string, opts ...RequestOption) (*http.Response, error)

func MultiGet

func MultiGet(urls []string, concurrency, wait int, opts ...RequestOption) ([]*http.Response, error)

func NewRequest

func NewRequest(method, url string, opts ...RequestOption) (*retryablehttp.Request, error)

func POST

func POST(url string, opts ...RequestOption) (*http.Response, error)

Types

type Client

type Client retryablehttp.Client

func NewClient

func NewClient(opts ...ClientOption) *Client

func (*Client) Do

func (c *Client) Do(req *retryablehttp.Request) (*http.Response, error)

func (*Client) Get

func (c *Client) Get(url string, opts ...RequestOption) (*http.Response, error)

func (*Client) MultiGet

func (c *Client) MultiGet(urls []string, concurrency, wait int, opts ...RequestOption) ([]*http.Response, error)

func (*Client) POST

func (c *Client) POST(url string, opts ...RequestOption) (*http.Response, error)

func (*Client) PipelineDo

func (c *Client) PipelineDo(reqs []*retryablehttp.Request, concurrency, wait int, cont func(resp *http.Response) error) error

func (*Client) PipelineGet

func (c *Client) PipelineGet(urls []string, concurrency, wait int, cont func(resp *http.Response) error, opts ...RequestOption) error

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL