Documentation ¶
Index ¶
- Variables
- func Close() error
- func CloseClient(c *Client) error
- func IdleLen() int
- func Len() int
- func Put(c *Client)
- func Remove(c *Client, err error)
- type Client
- type ClientPool
- func (p *ClientPool) Close() error
- func (p *ClientPool) CloseClient(client *Client) error
- func (p *ClientPool) Get(ctx context.Context) (*Client, error)
- func (p *ClientPool) GetStats() *Stats
- func (p *ClientPool) IdleLen() int
- func (p *ClientPool) Len() int
- func (p *ClientPool) NewClient(ctx context.Context) (*Client, error)
- func (p *ClientPool) Put(client *Client)
- func (p *ClientPool) ReapStaleClients() (int, error)
- func (p *ClientPool) Remove(client *Client, reason error)
- type Options
- type Pooler
- type Stats
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrClosed = errors.New("redis: client is closed")
View Source
var ErrPoolTimeout = errors.New("redis: connection pool timeout")
Functions ¶
func CloseClient ¶ added in v1.0.1
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) SetCreatedAt ¶
type ClientPool ¶
type ClientPool struct {
// contains filtered or unexported fields
}
func NewClientPool ¶
func NewClientPool(opt *Options) *ClientPool
func (*ClientPool) Close ¶
func (p *ClientPool) Close() error
func (*ClientPool) CloseClient ¶
func (p *ClientPool) CloseClient(client *Client) error
func (*ClientPool) GetStats ¶ added in v1.0.1
func (p *ClientPool) GetStats() *Stats
func (*ClientPool) IdleLen ¶
func (p *ClientPool) IdleLen() int
func (*ClientPool) Len ¶
func (p *ClientPool) Len() int
func (*ClientPool) Put ¶
func (p *ClientPool) Put(client *Client)
func (*ClientPool) ReapStaleClients ¶
func (p *ClientPool) ReapStaleClients() (int, error)
func (*ClientPool) Remove ¶
func (p *ClientPool) Remove(client *Client, reason error)
type Stats ¶
type Stats struct { Hits uint32 // number of times free client was found in the pool Misses uint32 // number of times free client was NOT found in the pool Timeouts uint32 // number of times a wait timeout occurred TotalClients uint32 // number of total client in the pool IdleClients uint32 // number of idle client in the pool StaleClients uint32 // number of stale client removed from the pool }
Stats contains pool state information and accumulated stats.
Click to show internal directories.
Click to hide internal directories.