Documentation ¶
Index ¶
- func DoDeadline(ctx context.Context, req *protocol.Request, resp *protocol.Response, ...) error
- func DoRequestFollowRedirects(ctx context.Context, req *protocol.Request, resp *protocol.Response, ...) (statusCode int, body []byte, err error)
- func DoTimeout(ctx context.Context, req *protocol.Request, resp *protocol.Response, ...) error
- func GetURL(ctx context.Context, dst []byte, url string, c Doer, ...) (statusCode int, body []byte, err error)
- func GetURLDeadline(ctx context.Context, dst []byte, url string, deadline time.Time, c Doer, ...) (statusCode int, body []byte, err error)
- func GetURLTimeout(ctx context.Context, dst []byte, url string, timeout time.Duration, c Doer, ...) (statusCode int, body []byte, err error)
- func PostURL(ctx context.Context, dst []byte, url string, postArgs *protocol.Args, c Doer, ...) (statusCode int, body []byte, err error)
- func StatusCodeIsRedirect(statusCode int) bool
- type DialFunc
- type Doer
- type DynamicConfig
- type HostClient
- type HostClientConfig
- type RetryIfFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoDeadline ¶
func GetURLDeadline ¶
func GetURLTimeout ¶
func StatusCodeIsRedirect ¶
StatusCodeIsRedirect returns true if the status code indicates a redirect.
Types ¶
type DialFunc ¶
DialFunc must establish connection to addr.
There is no need in establishing TLS (SSL) connection for https. The client automatically converts connection to TLS if HostClient.IsTLS is set.
TCP address passed to DialFunc always contains host and port. Example TCP addr values:
- foobar.com:80
- foobar.com:443
- foobar.com:8080
type DynamicConfig ¶ added in v0.2.0
DynamicConfig is config set which will be confirmed when starts a request.
type HostClient ¶
type HostClient interface { Doer SetDynamicConfig(dc *DynamicConfig) CloseIdleConnections() ShouldRemove() bool ConnectionCount() int }
type HostClientConfig ¶
type HostClientConfig struct { DynamicConfig Name string NoDefaultUserAgentHeader bool DialDualStack bool DisableHeaderNamesNormalizing bool DisablePathNormalizing bool IsTLS bool TLSConfig *tls.Config MaxConns int MaxIdempotentCallAttempts int MaxResponseBodySize int Dial DialFunc RetryIf RetryIfFunc ResponseBodyStream bool DialTimeout time.Duration MaxIdleConnDuration time.Duration MaxConnDuration time.Duration ReadTimeout time.Duration WriteTimeout time.Duration MaxConnWaitTimeout time.Duration }
type RetryIfFunc ¶
RetryIfFunc signature of retry if function
Request argument passed to RetryIfFunc, if there are any request errors.
Click to show internal directories.
Click to hide internal directories.