Documentation ¶
Index ¶
- Variables
- type BadConnError
- type Conn
- func (cn *Conn) Close() error
- func (cn *Conn) RemoteAddr() net.Addr
- func (cn *Conn) SetNetConn(netConn net.Conn)
- func (cn *Conn) SetUsedAt(tm time.Time)
- func (cn *Conn) UsedAt() time.Time
- func (cn *Conn) WithReader(ctx context.Context, timeout time.Duration, fn func(rd *proto.Reader) error) error
- func (cn *Conn) WithWriter(ctx context.Context, timeout time.Duration, fn func(wr *proto.Writer) error) error
- func (cn *Conn) Write(b []byte) (int, error)
- type ConnPool
- func (p *ConnPool) Close() error
- func (p *ConnPool) CloseConn(cn *Conn) error
- func (p *ConnPool) Filter(fn func(*Conn) bool) error
- func (p *ConnPool) Get(ctx context.Context) (*Conn, error)
- func (p *ConnPool) IdleLen() int
- func (p *ConnPool) Len() int
- func (p *ConnPool) NewConn(ctx context.Context) (*Conn, error)
- func (p *ConnPool) Put(cn *Conn)
- func (p *ConnPool) ReapStaleConns() (int, error)
- func (p *ConnPool) Remove(cn *Conn, reason error)
- func (p *ConnPool) Stats() *Stats
- type Options
- type Pooler
- type SingleConnPool
- func (p *SingleConnPool) Close() error
- func (p *SingleConnPool) CloseConn(cn *Conn) error
- func (p *SingleConnPool) Get(ctx context.Context) (*Conn, error)
- func (p *SingleConnPool) IdleLen() int
- func (p *SingleConnPool) Len() int
- func (p *SingleConnPool) NewConn(ctx context.Context) (*Conn, error)
- func (p *SingleConnPool) Put(cn *Conn)
- func (p *SingleConnPool) Remove(cn *Conn, reason error)
- func (p *SingleConnPool) Reset() error
- func (p *SingleConnPool) SetConn(cn *Conn)
- func (p *SingleConnPool) Stats() *Stats
- type Stats
- type StickyConnPool
- func (p *StickyConnPool) Close() error
- func (p *StickyConnPool) CloseConn(*Conn) error
- func (p *StickyConnPool) Get(ctx context.Context) (*Conn, error)
- func (p *StickyConnPool) IdleLen() int
- func (p *StickyConnPool) Len() int
- func (p *StickyConnPool) NewConn(context.Context) (*Conn, error)
- func (p *StickyConnPool) Put(cn *Conn)
- func (p *StickyConnPool) Remove(cn *Conn, reason error)
- func (p *StickyConnPool) Stats() *Stats
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrClosed = errors.New("redis: client is closed") ErrPoolTimeout = errors.New("redis: connection pool timeout") )
Functions ¶
This section is empty.
Types ¶
type BadConnError ¶
type BadConnError struct {
// contains filtered or unexported fields
}
func (BadConnError) Error ¶
func (e BadConnError) Error() string
func (BadConnError) Unwrap ¶
func (e BadConnError) Unwrap() error
type Conn ¶
type Conn struct { Inited bool // contains filtered or unexported fields }
func (*Conn) RemoteAddr ¶
func (*Conn) SetNetConn ¶
func (*Conn) WithReader ¶
func (*Conn) WithWriter ¶
type ConnPool ¶
type ConnPool struct {
// contains filtered or unexported fields
}
func NewConnPool ¶
func (*ConnPool) ReapStaleConns ¶
type SingleConnPool ¶
type SingleConnPool struct {
// contains filtered or unexported fields
}
func NewSingleConnPool ¶
func NewSingleConnPool(pool Pooler) *SingleConnPool
func (*SingleConnPool) Close ¶
func (p *SingleConnPool) Close() error
func (*SingleConnPool) CloseConn ¶
func (p *SingleConnPool) CloseConn(cn *Conn) error
func (*SingleConnPool) IdleLen ¶
func (p *SingleConnPool) IdleLen() int
func (*SingleConnPool) Len ¶
func (p *SingleConnPool) Len() int
func (*SingleConnPool) NewConn ¶
func (p *SingleConnPool) NewConn(ctx context.Context) (*Conn, error)
func (*SingleConnPool) Put ¶
func (p *SingleConnPool) Put(cn *Conn)
func (*SingleConnPool) Remove ¶
func (p *SingleConnPool) Remove(cn *Conn, reason error)
func (*SingleConnPool) Reset ¶
func (p *SingleConnPool) Reset() error
func (*SingleConnPool) SetConn ¶
func (p *SingleConnPool) SetConn(cn *Conn)
func (*SingleConnPool) Stats ¶
func (p *SingleConnPool) Stats() *Stats
type Stats ¶
type Stats struct { Hits uint32 // number of times free connection was found in the pool Misses uint32 // number of times free connection was NOT found in the pool Timeouts uint32 // number of times a wait timeout occurred TotalConns uint32 // number of total connections in the pool IdleConns uint32 // number of idle connections in the pool StaleConns uint32 // number of stale connections removed from the pool }
Stats contains pool state information and accumulated stats.
type StickyConnPool ¶
type StickyConnPool struct {
// contains filtered or unexported fields
}
func NewStickyConnPool ¶
func NewStickyConnPool(pool *ConnPool, reusable bool) *StickyConnPool
func (*StickyConnPool) Close ¶
func (p *StickyConnPool) Close() error
func (*StickyConnPool) CloseConn ¶
func (p *StickyConnPool) CloseConn(*Conn) error
func (*StickyConnPool) IdleLen ¶
func (p *StickyConnPool) IdleLen() int
func (*StickyConnPool) Len ¶
func (p *StickyConnPool) Len() int
func (*StickyConnPool) Put ¶
func (p *StickyConnPool) Put(cn *Conn)
func (*StickyConnPool) Remove ¶
func (p *StickyConnPool) Remove(cn *Conn, reason error)
func (*StickyConnPool) Stats ¶
func (p *StickyConnPool) Stats() *Stats
Click to show internal directories.
Click to hide internal directories.