Documentation ¶
Index ¶
- Variables
- 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) 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)
- func (p *ClientPool) Stats() *Stats
- 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 ¶
This section is empty.
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) 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)
func (*ClientPool) Stats ¶
func (p *ClientPool) Stats() *Stats
type Pooler ¶
type Pooler interface { NewClient(context.Context) (*Client, error) CloseClient(*Client) error Get(context.Context) (*Client, error) Put(*Client) Remove(*Client, error) Len() int IdleLen() int Stats() *Stats Close() error }
var DefaultPool Pooler
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.