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
- type ConnPool
- func (p *ConnPool) Close() (retErr error)
- func (p *ConnPool) Closed() bool
- func (p *ConnPool) FreeLen() int
- func (p *ConnPool) Get() (*Conn, bool, 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() (int, error)
- func (p *ConnPool) Remove(cn *Conn, reason error) error
- func (p *ConnPool) Stats() *Stats
- type Pooler
- type Stats
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 Buf []byte // read/write buffer Rd *bufio.Reader Columns [][]byte Wr *Buffer Inited bool UsedAt time.Time ProcessId int32 SecretKey int32 // contains filtered or unexported fields }
func (*Conn) CheckHealth ¶
func (*Conn) SetNetConn ¶
func (*Conn) SetReadWriteTimeout ¶
type ConnPool ¶
func NewConnPool ¶
func (*ConnPool) ReapStaleConns ¶
type Stats ¶
type Stats 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 }
Stats contains pool state information and accumulated stats.
Click to show internal directories.
Click to hide internal directories.