Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultIdleConnectionTimeout = 90 * time.Second
Variables ¶
View Source
var UseFastHttp = true
Functions ¶
This section is empty.
Types ¶
type DefaultHTTPClient ¶
type DefaultHTTPClient struct {
HTTPClientCommon
// contains filtered or unexported fields
}
HTTPClient is a reusable HTTP Client.
func NewDefaultHTTPClient ¶
func NewDefaultHTTPClient(host string, debug int, dialTimeout time.Duration, readTimeout time.Duration, writeTimeout time.Duration) *DefaultHTTPClient
NewHTTPClient creates a new HTTPClient.
func (*DefaultHTTPClient) Do ¶
func (w *DefaultHTTPClient) Do(q *Query, opts *HTTPClientDoOptions) (lag float64, err error)
Do performs the action specified by the given Query. It uses fasthttp, and tries to minimize heap allocations.
func (*DefaultHTTPClient) HostString ¶
func (w *DefaultHTTPClient) HostString() string
type FastHTTPClient ¶
type FastHTTPClient struct {
HTTPClientCommon
// contains filtered or unexported fields
}
HTTPClient is a reusable HTTP Client.
func NewFastHTTPClient ¶
func NewFastHTTPClient(host string, debug int, dialTimeout time.Duration, readTimeout time.Duration, writeTimeout time.Duration) *FastHTTPClient
NewHTTPClient creates a new HTTPClient.
func (*FastHTTPClient) Do ¶
func (w *FastHTTPClient) Do(q *Query, opts *HTTPClientDoOptions) (lag float64, err error)
Do performs the action specified by the given Query. It uses fasthttp, and tries to minimize heap allocations.
func (*FastHTTPClient) HostString ¶
func (w *FastHTTPClient) HostString() string
type HTTPClient ¶
type HTTPClient interface {
HostString() string
Do(q *Query, opts *HTTPClientDoOptions) (lag float64, err error)
}
HTTPClient interface.
type HTTPClientCommon ¶
type HTTPClientCommon struct {
Host []byte
HostString string
// contains filtered or unexported fields
}
HTTPClient is a reusable HTTP Client.
type HTTPClientDoOptions ¶
type HTTPClientDoOptions struct {
ContentType string
Authorization string
Debug int
PrettyPrintResponses bool
}
HTTPClientDoOptions wraps options uses when calling `Do`.
Click to show internal directories.
Click to hide internal directories.