Versions in this module Expand all Collapse all v7 v7.5.0 May 21, 2020 Changes in this version + var ErrClosed = errors.New("redis: client is closed") + var ErrPoolTimeout = errors.New("redis: connection pool timeout") + type BadConnError struct + func (e BadConnError) Error() string + func (e BadConnError) Unwrap() error + type Conn struct + Inited bool + func NewConn(netConn net.Conn) *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 struct + func NewConnPool(opt *Options) *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 struct + Dialer func(context.Context) (net.Conn, error) + IdleCheckFrequency time.Duration + IdleTimeout time.Duration + MaxConnAge time.Duration + MinIdleConns int + OnClose func(*Conn) error + PoolSize int + PoolTimeout time.Duration + type Pooler interface + Close func() error + CloseConn func(*Conn) error + Get func(context.Context) (*Conn, error) + IdleLen func() int + Len func() int + NewConn func(context.Context) (*Conn, error) + Put func(*Conn) + Remove func(*Conn, error) + Stats func() *Stats + type SingleConnPool struct + func NewSingleConnPool(pool Pooler) *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 struct + Hits uint32 + IdleConns uint32 + Misses uint32 + StaleConns uint32 + Timeouts uint32 + TotalConns uint32 + type StickyConnPool struct + func NewStickyConnPool(pool *ConnPool, reusable bool) *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 Other modules containing this package github.com/CPTSLLC/redis