Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultDialTimeout = 3 * time.Second
View Source
const DefaultMaxConnsPerHost = 512
View Source
const DefaultMaxIdleConnDuration = 10 * time.Second
Variables ¶
View Source
var ErrNoFreeConns = errors.New("no free connections available to host")
View Source
var ErrTimeout = &timeoutError{}
ErrTimeout is returned from timed out calls.
Functions ¶
func AcquireTimer ¶
AcquireTimer returns a time.Timer from the pool and updates it to send the current time on its channel after at least timeout.
The returned Timer may be returned to the pool with ReleaseTimer when no longer needed. This allows reducing GC load.
func ReleaseTimer ¶
ReleaseTimer returns the time.Timer acquired via AcquireTimer to the pool and prevents the Timer from firing.
Do not access the released time.Timer or read from it's channel otherwise data races may occur.
Types ¶
type Client ¶
type Client struct { ReadTimeout time.Duration WriteTimeout time.Duration MaxConnsPerHost int MaxConnWaitTimeout time.Duration MaxIdleConnDuration time.Duration Dial DialFunc // contains filtered or unexported fields }
func (*Client) CloseIdleConnections ¶
func (c *Client) CloseIdleConnections()
type HostClient ¶
type HostClient struct { Addr string ReadTimeout time.Duration WriteTimeout time.Duration MaxConns int MaxConnWaitTimeout time.Duration MaxIdleConnDuration time.Duration Dial DialFunc // contains filtered or unexported fields }
func (*HostClient) CloseIdleConnections ¶
func (c *HostClient) CloseIdleConnections()
Click to show internal directories.
Click to hide internal directories.