Documentation ¶
Index ¶
- type Client
- func (c *Client) BytesDownloaded() int64
- func (c *Client) BytesUploaded() int64
- func (c *Client) Do(req *http.Request) (*http.Response, error)
- func (c *Client) FakeDo()
- func (c *Client) Get(url string) (*http.Response, error)
- func (c *Client) GetRPS() int32
- func (c *Client) Post(url, contentType string, body io.Reader) (resp *http.Response, err error)
- func (c *Client) PostForm(url string, data url.Values) (resp *http.Response, err error)
- func (c *Client) SetMaxRPS(maxRPS int32)
- func (c *Client) SetTransport(tr http.RoundTripper)
- func (c *Client) SetUserAgent(userAgent string)
- func (c *Client) UserAgent() string
- func (c *Client) WithTransport(tr http.RoundTripper, clb func(*Client) error) error
- type IHttpClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client special http client that can throttle requests per seconds (RPS). Also collect stats about current RPS and overall bytes downloaded/uploaded.
func (*Client) BytesDownloaded ¶
func (*Client) BytesUploaded ¶
func (*Client) SetTransport ¶
func (c *Client) SetTransport(tr http.RoundTripper)
func (*Client) SetUserAgent ¶
func (*Client) WithTransport ¶
Click to show internal directories.
Click to hide internal directories.