Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultTransport ¶
DefaultTransport returns a new http.Transport which is a clone of the http.DefaultTransport. This is to avoid accidental transport overrides because http.DefaultTransport. is a package global.
Types ¶
type HTTP ¶
type HTTP struct {
// contains filtered or unexported fields
}
HTTP is an HTTP client.
func NewHTTP ¶
func NewHTTP(opts ...HTTPOption) *HTTP
NewHTTP creates a new HTTP client and returns it.
type HTTPOption ¶
type HTTPOption func(*HTTPOptions)
HTTPOption is HTTP client functional option.
func WithHTTPClient ¶
func WithHTTPClient(c *http.Client) HTTPOption
WithHTTPClient sets the HTTP client to c.
func WithLimiter ¶
func WithLimiter(l Limiter) HTTPOption
WithLimiter sets the http rate limiter to l.
type HTTPOptions ¶
HTTPOptions configure the HTTP client.
Click to show internal directories.
Click to hide internal directories.