Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientOption ¶
type ClientOption func(fhc *FancyHTTPClient)
ClientOption apply custom options to the client
func WithDelay ¶
func WithDelay(delay time.Duration) ClientOption
WithDelay sets up the client to space out each requests sent
func WithMaxConn ¶
func WithMaxConn(maxConn int) ClientOption
WithMaxConn sets up the client to limit its connection to a set number
type FancyHTTPClient ¶
type FancyHTTPClient struct {
// contains filtered or unexported fields
}
FancyHTTPClient is a custom HTTP client that is able to handle
func New ¶
func New(hc Doer, options ...ClientOption) *FancyHTTPClient
New returns an instance of FancyHTTPClient according to the delay and timeout provided
func (*FancyHTTPClient) Destroy ¶ added in v0.2.0
func (c *FancyHTTPClient) Destroy()
Destroy waits for existing work to finish and stops the workerpool, function will only return after all work has been done
func (*FancyHTTPClient) DoBunch ¶
func (c *FancyHTTPClient) DoBunch(reqs []*http.Request) ([]*ResponseGetter, error)
DoBunch fires off a bunch of requests with the configured delay and returns all, reserving the order of slice passed in
type ResponseGetter ¶
type ResponseGetter struct {
// contains filtered or unexported fields
}
ResponseGetter contains either an http response or an error