Documentation
¶
Index ¶
- Variables
- type Closer
- type Conn
- 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) Remove(cn *Conn)
- func (p *ConnPool) Stats() *Stats
- type Options
- type Pooler
- type Stats
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrClosed = errors.New("net/pool: connection is closed") ErrPoolTimeout = errors.New("net/pool: connection pool timeout") )
Functions ¶
This section is empty.
Types ¶
type ConnPool ¶
type ConnPool struct {
// contains filtered or unexported fields
}
type Pooler ¶
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.
Click to show internal directories.
Click to hide internal directories.