package pool

Import Path
	github.com/redis/go-redis/v9/internal/pool (on go.dev)

Dependency Relation
	imports 12 packages, and imported by one package


Package-Level Type Names (total 8)
/* sort by: | */
( BadConnError) Error() string ( BadConnError) Unwrap() error BadConnError : error BadConnError : golang.org/x/xerrors.Wrapper
Inited bool (*Conn) Close() error (*Conn) RemoteAddr() net.Addr (*Conn) SetNetConn(netConn net.Conn) (*Conn) SetUsedAt(tm time.Time) (*Conn) UsedAt() time.Time (*Conn) WithReader(ctx context.Context, timeout time.Duration, fn func(rd *proto.Reader) error) error (*Conn) WithWriter(ctx context.Context, timeout time.Duration, fn func(wr *proto.Writer) error) error (*Conn) Write(b []byte) (int, error) *Conn : github.com/miekg/dns.Writer *Conn : github.com/prometheus/common/expfmt.Closer *Conn : internal/bisect.Writer *Conn : io.Closer *Conn : io.WriteCloser *Conn : io.Writer func NewConn(netConn net.Conn) *Conn func (*ConnPool).Get(ctx context.Context) (*Conn, error) func (*ConnPool).NewConn(ctx context.Context) (*Conn, error) func Pooler.Get(context.Context) (*Conn, error) func Pooler.NewConn(context.Context) (*Conn, error) func (*SingleConnPool).Get(ctx context.Context) (*Conn, error) func (*SingleConnPool).NewConn(ctx context.Context) (*Conn, error) func (*StickyConnPool).Get(ctx context.Context) (*Conn, error) func (*StickyConnPool).NewConn(ctx context.Context) (*Conn, error) func NewSingleConnPool(pool Pooler, cn *Conn) *SingleConnPool func (*ConnPool).CloseConn(cn *Conn) error func (*ConnPool).Put(ctx context.Context, cn *Conn) func (*ConnPool).Remove(_ context.Context, cn *Conn, reason error) func Pooler.CloseConn(*Conn) error func Pooler.Put(context.Context, *Conn) func Pooler.Remove(context.Context, *Conn, error) func (*SingleConnPool).CloseConn(cn *Conn) error func (*SingleConnPool).Put(ctx context.Context, cn *Conn) func (*SingleConnPool).Remove(ctx context.Context, cn *Conn, reason error) func (*StickyConnPool).CloseConn(cn *Conn) error func (*StickyConnPool).Put(ctx context.Context, cn *Conn) func (*StickyConnPool).Remove(ctx context.Context, cn *Conn, reason error)
(*ConnPool) Close() error (*ConnPool) CloseConn(cn *Conn) error (*ConnPool) Filter(fn func(*Conn) bool) error Get returns existed connection from the pool or creates a new one. IdleLen returns number of idle connections. Len returns total number of connections. (*ConnPool) NewConn(ctx context.Context) (*Conn, error) (*ConnPool) Put(ctx context.Context, cn *Conn) (*ConnPool) Remove(_ context.Context, cn *Conn, reason error) (*ConnPool) Stats() *Stats *ConnPool : Pooler *ConnPool : github.com/prometheus/common/expfmt.Closer *ConnPool : io.Closer func NewConnPool(opt *Options) *ConnPool
( Pooler) Close() error ( Pooler) CloseConn(*Conn) error ( Pooler) Get(context.Context) (*Conn, error) ( Pooler) IdleLen() int ( Pooler) Len() int ( Pooler) NewConn(context.Context) (*Conn, error) ( Pooler) Put(context.Context, *Conn) ( Pooler) Remove(context.Context, *Conn, error) ( Pooler) Stats() *Stats *ConnPool *SingleConnPool *StickyConnPool Pooler : github.com/prometheus/common/expfmt.Closer Pooler : io.Closer func NewSingleConnPool(pool Pooler, cn *Conn) *SingleConnPool func NewStickyConnPool(pool Pooler) *StickyConnPool
(*SingleConnPool) Close() error (*SingleConnPool) CloseConn(cn *Conn) error (*SingleConnPool) Get(ctx context.Context) (*Conn, error) (*SingleConnPool) IdleLen() int (*SingleConnPool) Len() int (*SingleConnPool) NewConn(ctx context.Context) (*Conn, error) (*SingleConnPool) Put(ctx context.Context, cn *Conn) (*SingleConnPool) Remove(ctx context.Context, cn *Conn, reason error) (*SingleConnPool) Stats() *Stats *SingleConnPool : Pooler *SingleConnPool : github.com/prometheus/common/expfmt.Closer *SingleConnPool : io.Closer func NewSingleConnPool(pool Pooler, cn *Conn) *SingleConnPool
Stats contains pool state information and accumulated stats. // number of times free connection was found in the pool // number of idle connections in the pool // number of times free connection was NOT found in the pool // number of stale connections removed from the pool // number of times a wait timeout occurred // number of total connections in the pool func (*ConnPool).Stats() *Stats func Pooler.Stats() *Stats func (*SingleConnPool).Stats() *Stats func (*StickyConnPool).Stats() *Stats
(*StickyConnPool) Close() error (*StickyConnPool) CloseConn(cn *Conn) error (*StickyConnPool) Get(ctx context.Context) (*Conn, error) (*StickyConnPool) IdleLen() int (*StickyConnPool) Len() int (*StickyConnPool) NewConn(ctx context.Context) (*Conn, error) (*StickyConnPool) Put(ctx context.Context, cn *Conn) (*StickyConnPool) Remove(ctx context.Context, cn *Conn, reason error) (*StickyConnPool) Reset(ctx context.Context) error (*StickyConnPool) Stats() *Stats *StickyConnPool : Pooler *StickyConnPool : github.com/prometheus/common/expfmt.Closer *StickyConnPool : io.Closer func NewStickyConnPool(pool Pooler) *StickyConnPool
Package-Level Functions (total 4)
func NewConn(netConn net.Conn) *Conn
Package-Level Variables (total 2)
ErrClosed performs any operation on the closed client will return this error.
ErrPoolTimeout timed out waiting to get a connection from the connection pool.