Documentation ¶
Index ¶
- Variables
- func SetIdleCheckFrequency(d time.Duration)
- type Buffer
- func (buf *Buffer) FinishMessage()
- func (buf *Buffer) FinishNullParam()
- func (buf *Buffer) FinishParam()
- func (buf *Buffer) Flush() error
- func (buf *Buffer) ReadFrom(r io.Reader) (int64, error)
- func (buf *Buffer) Reset()
- func (buf *Buffer) StartMessage(c byte)
- func (buf *Buffer) StartParam()
- func (buf *Buffer) Write(b []byte) (int, error)
- func (buf *Buffer) WriteByte(c byte)
- func (buf *Buffer) WriteBytes(b []byte)
- func (buf *Buffer) WriteInt16(num int16)
- func (buf *Buffer) WriteInt32(num int32)
- func (buf *Buffer) WriteString(s string)
- type Conn
- func (cn *Conn) Close() error
- func (cn *Conn) IsStale(timeout time.Duration) bool
- func (cn *Conn) NextId() string
- func (cn *Conn) Read(b []byte) (int, error)
- func (cn *Conn) ReadN(n int) ([]byte, error)
- func (cn *Conn) SetReadTimeout(dur time.Duration)
- func (cn *Conn) SetWriteTimeout(dur time.Duration)
- func (cn *Conn) Write(b []byte) (int, error)
- type ConnPool
- func (p *ConnPool) Close() (retErr error)
- func (p *ConnPool) Closed() bool
- func (p *ConnPool) FreeLen() int
- func (p *ConnPool) Get() (*Conn, error)
- func (p *ConnPool) Len() int
- func (p *ConnPool) NewConn() (*Conn, error)
- func (p *ConnPool) PopFree() *Conn
- func (p *ConnPool) Put(cn *Conn) error
- func (p *ConnPool) ReapStaleConns() (n int, err error)
- func (p *ConnPool) Remove(cn *Conn, reason error) error
- func (p *ConnPool) Stats() *PoolStats
- type PoolStats
- type Pooler
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrClosed = errors.New("pg: database is closed") ErrPoolTimeout = errors.New("pg: connection pool timeout") )
Functions ¶
func SetIdleCheckFrequency ¶
Types ¶
type Buffer ¶
type Buffer struct { Bytes []byte // contains filtered or unexported fields }
func (*Buffer) FinishMessage ¶
func (buf *Buffer) FinishMessage()
func (*Buffer) FinishNullParam ¶
func (buf *Buffer) FinishNullParam()
func (*Buffer) FinishParam ¶
func (buf *Buffer) FinishParam()
func (*Buffer) StartMessage ¶
func (*Buffer) StartParam ¶
func (buf *Buffer) StartParam()
func (*Buffer) WriteBytes ¶
func (*Buffer) WriteInt16 ¶
func (*Buffer) WriteInt32 ¶
func (*Buffer) WriteString ¶
type Conn ¶
type Conn struct { NetConn net.Conn Rd *bufio.Reader // read buffer Wr *Buffer // write buffer Buf []byte // reusable Columns []string // reusable Inited bool UsedAt time.Time ProcessId int32 SecretKey int32 // contains filtered or unexported fields }
func (*Conn) SetReadTimeout ¶
func (*Conn) SetWriteTimeout ¶
type ConnPool ¶
type ConnPool struct { DialLimiter *ratelimit.RateLimiter OnClose func(*Conn) error // contains filtered or unexported fields }
func NewConnPool ¶
func (*ConnPool) ReapStaleConns ¶
type PoolStats ¶
type PoolStats struct { Requests uint32 // number of times a connection was requested by the pool Hits uint32 // number of times free connection was found in the pool Timeouts uint32 // number of times a wait timeout occurred TotalConns uint32 // the number of total connections in the pool FreeConns uint32 // the number of free connections in the pool }
PoolStats contains pool state information and accumulated stats.
Click to show internal directories.
Click to hide internal directories.