Documentation
¶
Index ¶
- Variables
- type Conn
- type ConnPool
- func (p *ConnPool) Close() error
- func (p *ConnPool) CloseConn(cn *Conn)
- func (p *ConnPool) Filter(fn func(*Conn) bool)
- func (p *ConnPool) Get() (*Conn, error)
- func (p *ConnPool) IdleLen() int
- func (p *ConnPool) Len() int
- 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("client is closed") ErrPoolTimeout = errors.New("connection pool timeout") )
vars
Functions ¶
This section is empty.
Types ¶
type ConnPool ¶
type ConnPool struct {
// contains filtered or unexported fields
}
ConnPool ...
type Options ¶
type Options struct {
Factory func() (ldap.Client, error)
OnClose func(*Conn) error
PoolSize int
MinIdleConns int
MaxConnAge time.Duration
PoolTimeout time.Duration
IdleTimeout time.Duration
IdleCheckFrequency time.Duration
}
Options ...
type Pooler ¶
type Pooler interface {
Get() (*Conn, error)
Put(c *Conn)
Len() int
IdleLen() int
Stats() *Stats
Close() error
}
Pooler ...
type Stats ¶
type Stats struct {
Hits uint32 `json:"hits"` // number of times free connection was found in the pool
Misses uint32 `json:"misses"` // number of times free connection was NOT found in the pool
Timeouts uint32 `json:"timeouts"` // number of times a wait timeout occurred
TotalConns uint32 `json:"totalConns"` // number of total connections in the pool
IdleConns uint32 `json:"idelConns"` // number of idle connections in the pool
StaleConns uint32 `json:"staleConns"` // 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.