Documentation ¶
Index ¶
- Variables
- type BadConnError
- type Config
- type Conn
- func (cn *Conn) Close() error
- func (cn *Conn) Closed() bool
- func (cn *Conn) RemoteAddr() net.Addr
- 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 *chproto.Reader) error) error
- func (cn *Conn) WithWriter(ctx context.Context, timeout time.Duration, fn func(wb *chproto.Writer)) error
- type ConnPool
- func (p *ConnPool) Close() error
- func (p *ConnPool) CloseConn(cn *Conn) 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, reason error)
- func (p *ConnPool) Stats() *Stats
- type Pooler
- type Stats
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrClosed = errors.New("ch: database is closed") ErrPoolTimeout = errors.New("ch: 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 { ServerInfo chproto.ServerInfo Inited bool // contains filtered or unexported fields }
func (*Conn) RemoteAddr ¶
func (*Conn) WithReader ¶
type ConnPool ¶
type ConnPool struct {
// contains filtered or unexported fields
}
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.