package pool

Import Path
	github.com/go-pg/pg/v10/internal/pool (on go.dev)

Dependency Relation
	imports 13 packages, and imported by 4 packages


Package-Level Type Names (total 15, all are exported)
/* sort exporteds by: | */
( BadConnError) Error() string ( BadConnError) Unwrap() error BadConnError : error
(*BufReader) Available() int Buffered returns the number of bytes that can be read from the current buffer. (*BufReader) Bytes() []byte (*BufReader) BytesReader(n int) *BytesReader Discard skips the next n bytes, returning the number of bytes discarded. If Discard skips fewer than n bytes, it also returns an error. If 0 <= n <= b.Buffered(), Discard is guaranteed to succeed without reading from the underlying io.BufReader. (*BufReader) Read(p []byte) (n int, err error) (*BufReader) ReadByte() (byte, error) (*BufReader) ReadBytes(fn func(byte) bool) (line []byte, err error) (*BufReader) ReadFull() ([]byte, error) (*BufReader) ReadFullTemp() ([]byte, error) (*BufReader) ReadN(n int) (line []byte, err error) ReadSlice reads until the first occurrence of delim in the input, returning a slice pointing at the bytes in the buffer. The bytes stop being valid at the next read. If ReadSlice encounters an error before finding a delimiter, it returns all the data in the buffer and the error itself (often io.EOF). ReadSlice fails with error ErrBufferFull if the buffer fills without a delim. Because the data returned from ReadSlice will be overwritten by the next I/O operation, most clients should use ReadBytes or ReadString instead. ReadSlice returns err != nil if and only if line does not end in delim. (*BufReader) Reset(rd io.Reader) (*BufReader) SetAvailable(n int) (*BufReader) UnreadByte() error *BufReader : Reader *BufReader : compress/flate.Reader *BufReader : io.ByteReader *BufReader : io.ByteScanner *BufReader : io.Reader func NewBufReader(bufSize int) *BufReader
(*BytesReader) Buffered() int (*BytesReader) Bytes() []byte (*BytesReader) Discard(n int) (int, error) (*BytesReader) Read(b []byte) (n int, err error) (*BytesReader) ReadByte() (byte, error) (*BytesReader) ReadBytes(fn func(byte) bool) ([]byte, error) (*BytesReader) ReadFull() ([]byte, error) (*BytesReader) ReadFullTemp() ([]byte, error) (*BytesReader) ReadN(n int) ([]byte, error) (*BytesReader) ReadSlice(delim byte) ([]byte, error) (*BytesReader) Reset(b []byte) (*BytesReader) UnreadByte() error *BytesReader : Reader *BytesReader : compress/flate.Reader *BytesReader : io.ByteReader *BytesReader : io.ByteScanner *BytesReader : io.Reader func NewBytesReader(b []byte) *BytesReader func (*BufReader).BytesReader(n int) *BytesReader
(*ColumnAlloc) Columns() []ColumnInfo (*ColumnAlloc) New(index int16, name []byte) *ColumnInfo (*ColumnAlloc) Reset() func NewColumnAlloc() *ColumnAlloc
DataType int32 Index int16 Name string func (*ColumnAlloc).Columns() []ColumnInfo func (*ColumnAlloc).New(index int16, name []byte) *ColumnInfo func github.com/go-pg/pg/v10.(*Ints).ScanColumn(col types.ColumnInfo, rd types.Reader, n int) error func github.com/go-pg/pg/v10.(*IntSet).ScanColumn(col types.ColumnInfo, rd types.Reader, n int) error func github.com/go-pg/pg/v10.(*Strings).ScanColumn(col types.ColumnInfo, rd types.Reader, n int) error func github.com/go-pg/pg/v10/orm.ColumnScanner.ScanColumn(col types.ColumnInfo, rd types.Reader, n int) error func github.com/go-pg/pg/v10/orm.Discard.ScanColumn(col types.ColumnInfo, rd types.Reader, n int) error func github.com/go-pg/pg/v10/types.ReadColumnValue(col types.ColumnInfo, rd types.Reader, n int) (interface{}, error)
Inited bool ProcessID int32 SecretKey int32 (*Conn) Close() error (*Conn) LockReader() (*Conn) NetConn() net.Conn (*Conn) NextID() string (*Conn) RemoteAddr() net.Addr (*Conn) SetNetConn(netConn net.Conn) (*Conn) SetUsedAt(tm time.Time) (*Conn) UsedAt() time.Time (*Conn) WithReader(ctx context.Context, timeout time.Duration, fn func(rd *ReaderContext) error) error (*Conn) WithWriter(ctx context.Context, timeout time.Duration, fn func(wb *WriteBuffer) error) error (*Conn) WriteBuffer(ctx context.Context, timeout time.Duration, wb *WriteBuffer) error *Conn : io.Closer func NewConn(netConn net.Conn) *Conn func (*ConnPool).Get(ctx context.Context) (*Conn, error) func (*ConnPool).NewConn(c context.Context) (*Conn, error) func Pooler.Get(context.Context) (*Conn, error) func Pooler.NewConn(context.Context) (*Conn, error) func (*SingleConnPool).Get(ctx context.Context) (*Conn, error) func (*SingleConnPool).NewConn(ctx context.Context) (*Conn, error) func (*StickyConnPool).Get(ctx context.Context) (*Conn, error) func (*StickyConnPool).NewConn(ctx context.Context) (*Conn, error) func NewSingleConnPool(pool Pooler, cn *Conn) *SingleConnPool func (*ConnPool).CloseConn(cn *Conn) error func (*ConnPool).Put(ctx context.Context, cn *Conn) func (*ConnPool).Remove(ctx context.Context, cn *Conn, reason error) func Pooler.CloseConn(*Conn) error func Pooler.Put(context.Context, *Conn) func Pooler.Remove(context.Context, *Conn, error) func (*SingleConnPool).CloseConn(cn *Conn) error func (*SingleConnPool).Put(ctx context.Context, cn *Conn) func (*SingleConnPool).Remove(ctx context.Context, cn *Conn, reason error) func (*StickyConnPool).CloseConn(cn *Conn) error func (*StickyConnPool).Put(ctx context.Context, cn *Conn) func (*StickyConnPool).Remove(ctx context.Context, cn *Conn, reason error)
(*ConnPool) Close() error (*ConnPool) CloseConn(cn *Conn) error (*ConnPool) Filter(fn func(*Conn) bool) error Get returns existed connection from the pool or creates a new one. IdleLen returns number of idle connections. Len returns total number of connections. (*ConnPool) NewConn(c context.Context) (*Conn, error) (*ConnPool) Put(ctx context.Context, cn *Conn) (*ConnPool) ReapStaleConns() (int, error) (*ConnPool) Remove(ctx context.Context, cn *Conn, reason error) (*ConnPool) Stats() *Stats *ConnPool : Pooler *ConnPool : io.Closer func NewConnPool(opt *Options) *ConnPool
Dialer func(context.Context) (net.Conn, error) IdleCheckFrequency time.Duration IdleTimeout time.Duration MaxConnAge time.Duration MinIdleConns int OnClose func(*Conn) error PoolSize int PoolTimeout time.Duration func NewConnPool(opt *Options) *ConnPool
( Pooler) Close() error ( Pooler) CloseConn(*Conn) error ( Pooler) Get(context.Context) (*Conn, error) ( Pooler) IdleLen() int ( Pooler) Len() int ( Pooler) NewConn(context.Context) (*Conn, error) ( Pooler) Put(context.Context, *Conn) ( Pooler) Remove(context.Context, *Conn, error) ( Pooler) Stats() *Stats *ConnPool *SingleConnPool *StickyConnPool Pooler : io.Closer func NewSingleConnPool(pool Pooler, cn *Conn) *SingleConnPool func NewStickyConnPool(pool Pooler) *StickyConnPool
( Reader) Buffered() int ( Reader) Bytes() []byte ( Reader) Discard(int) (int, error) ( Reader) Read([]byte) (int, error) ( Reader) ReadByte() (byte, error) ReadBytes(fn func(byte) bool) ([]byte, error) ReadN(int) ([]byte, error) ( Reader) ReadFullTemp() ([]byte, error) ( Reader) ReadSlice(byte) ([]byte, error) ( Reader) UnreadByte() error *BufReader *BytesReader ReaderContext github.com/go-pg/pg/v10/internal/parser.StreamingParser Reader : compress/flate.Reader Reader : io.ByteReader Reader : io.ByteScanner Reader : io.Reader func github.com/go-pg/pg/v10/internal/parser.NewStreamingParser(rd Reader) parser.StreamingParser func github.com/go-pg/pg/v10.(*Ints).ScanColumn(col types.ColumnInfo, rd types.Reader, n int) error func github.com/go-pg/pg/v10.(*IntSet).ScanColumn(col types.ColumnInfo, rd types.Reader, n int) error func github.com/go-pg/pg/v10.(*Strings).ScanColumn(col types.ColumnInfo, rd types.Reader, n int) error func github.com/go-pg/pg/v10/orm.ColumnScanner.ScanColumn(col types.ColumnInfo, rd types.Reader, n int) error func github.com/go-pg/pg/v10/orm.Discard.ScanColumn(col types.ColumnInfo, rd types.Reader, n int) error func github.com/go-pg/pg/v10/orm.(*Field).ScanValue(strct reflect.Value, rd types.Reader, n int) error func github.com/go-pg/pg/v10/types.NewHexDecoder(rd types.Reader, n int) (io.Reader, error) func github.com/go-pg/pg/v10/types.ReadBytes(rd types.Reader, b []byte) error func github.com/go-pg/pg/v10/types.ReadColumnValue(col types.ColumnInfo, rd types.Reader, n int) (interface{}, error) func github.com/go-pg/pg/v10/types.Scan(v interface{}, rd types.Reader, n int) error func github.com/go-pg/pg/v10/types.ScanBool(rd types.Reader, n int) (bool, error) func github.com/go-pg/pg/v10/types.ScanBytes(rd types.Reader, n int) ([]byte, error) func github.com/go-pg/pg/v10/types.ScanFloat32(rd types.Reader, n int) (float32, error) func github.com/go-pg/pg/v10/types.ScanFloat64(rd types.Reader, n int) (float64, error) func github.com/go-pg/pg/v10/types.ScanInt(rd types.Reader, n int) (int, error) func github.com/go-pg/pg/v10/types.ScanInt64(rd types.Reader, n int) (int64, error) func github.com/go-pg/pg/v10/types.ScanString(rd types.Reader, n int) (string, error) func github.com/go-pg/pg/v10/types.ScanTime(rd types.Reader, n int) (time.Time, error) func github.com/go-pg/pg/v10/types.ScanUint64(rd types.Reader, n int) (uint64, error) func github.com/go-pg/pg/v10/types.ScanValue(v reflect.Value, rd types.Reader, n int) error func github.com/go-pg/pg/v10/types.(*Array).ScanValue(rd types.Reader, n int) error func github.com/go-pg/pg/v10/types.ArrayValueScanner.BeforeScanArrayValue(rd types.Reader, n int) error func github.com/go-pg/pg/v10/types.ArrayValueScanner.ScanArrayValue(rd types.Reader, n int) error func github.com/go-pg/pg/v10/types.(*Hstore).ScanValue(rd types.Reader, n int) error func github.com/go-pg/pg/v10/types.ValueScanner.ScanValue(rd types.Reader, n int) error
BufReader *BufReader ColumnAlloc *ColumnAlloc ( ReaderContext) Available() int Buffered returns the number of bytes that can be read from the current buffer. ( ReaderContext) Bytes() []byte ( ReaderContext) BytesReader(n int) *BytesReader Discard skips the next n bytes, returning the number of bytes discarded. If Discard skips fewer than n bytes, it also returns an error. If 0 <= n <= b.Buffered(), Discard is guaranteed to succeed without reading from the underlying io.BufReader. ( ReaderContext) Read(p []byte) (n int, err error) ( ReaderContext) ReadByte() (byte, error) ( ReaderContext) ReadBytes(fn func(byte) bool) (line []byte, err error) ( ReaderContext) ReadFull() ([]byte, error) ( ReaderContext) ReadFullTemp() ([]byte, error) ( ReaderContext) ReadN(n int) (line []byte, err error) ReadSlice reads until the first occurrence of delim in the input, returning a slice pointing at the bytes in the buffer. The bytes stop being valid at the next read. If ReadSlice encounters an error before finding a delimiter, it returns all the data in the buffer and the error itself (often io.EOF). ReadSlice fails with error ErrBufferFull if the buffer fills without a delim. Because the data returned from ReadSlice will be overwritten by the next I/O operation, most clients should use ReadBytes or ReadString instead. ReadSlice returns err != nil if and only if line does not end in delim. ( ReaderContext) Reset(rd io.Reader) ( ReaderContext) SetAvailable(n int) ( ReaderContext) UnreadByte() error ReaderContext : Reader ReaderContext : compress/flate.Reader ReaderContext : io.ByteReader ReaderContext : io.ByteScanner ReaderContext : io.Reader func GetReaderContext() *ReaderContext func NewReaderContext() *ReaderContext func PutReaderContext(rd *ReaderContext)
(*SingleConnPool) Close() error (*SingleConnPool) CloseConn(cn *Conn) error (*SingleConnPool) Get(ctx context.Context) (*Conn, error) (*SingleConnPool) IdleLen() int (*SingleConnPool) Len() int (*SingleConnPool) NewConn(ctx context.Context) (*Conn, error) (*SingleConnPool) Put(ctx context.Context, cn *Conn) (*SingleConnPool) Remove(ctx context.Context, cn *Conn, reason error) (*SingleConnPool) Stats() *Stats *SingleConnPool : Pooler *SingleConnPool : io.Closer func NewSingleConnPool(pool Pooler, cn *Conn) *SingleConnPool
Stats contains pool state information and accumulated stats. // number of times free connection was found in the pool // number of idle connections in the pool // number of times free connection was NOT found in the pool // number of stale connections removed from the pool // number of times a wait timeout occurred // number of total connections in the pool func (*ConnPool).Stats() *Stats func Pooler.Stats() *Stats func (*SingleConnPool).Stats() *Stats func (*StickyConnPool).Stats() *Stats
(*StickyConnPool) Close() error (*StickyConnPool) CloseConn(cn *Conn) error (*StickyConnPool) Get(ctx context.Context) (*Conn, error) (*StickyConnPool) IdleLen() int (*StickyConnPool) Len() int (*StickyConnPool) NewConn(ctx context.Context) (*Conn, error) (*StickyConnPool) Put(ctx context.Context, cn *Conn) (*StickyConnPool) Remove(ctx context.Context, cn *Conn, reason error) (*StickyConnPool) Reset(ctx context.Context) error (*StickyConnPool) Stats() *Stats *StickyConnPool : Pooler *StickyConnPool : io.Closer func NewStickyConnPool(pool Pooler) *StickyConnPool
Bytes []byte (*WriteBuffer) FinishMessage() (*WriteBuffer) FinishNullParam() (*WriteBuffer) FinishParam() (*WriteBuffer) Query() []byte (*WriteBuffer) ReadFrom(r io.Reader) (int64, error) (*WriteBuffer) Reset() (*WriteBuffer) StartMessage(c byte) (*WriteBuffer) StartParam() (*WriteBuffer) Write(b []byte) (int, error) (*WriteBuffer) WriteByte(c byte) error (*WriteBuffer) WriteBytes(b []byte) (*WriteBuffer) WriteInt16(num int16) (*WriteBuffer) WriteInt32(num int32) (*WriteBuffer) WriteString(s string) *WriteBuffer : io.ByteWriter *WriteBuffer : io.ReaderFrom *WriteBuffer : io.Writer func GetWriteBuffer() *WriteBuffer func NewWriteBuffer() *WriteBuffer func PutWriteBuffer(wb *WriteBuffer) func (*Conn).WriteBuffer(ctx context.Context, timeout time.Duration, wb *WriteBuffer) error
Package-Level Variables (total 7, in which 2 are exported)
Package-Level Constants (total 4, none are exported)