type github.com/go-pg/pg/v10/internal/pool.Conn
94 uses
github.com/go-pg/pg/v10/internal/pool (current package)
conn.go#L13: type Conn struct {
conn.go#L27: func NewConn(netConn net.Conn) *Conn {
conn.go#L28: cn := &Conn{
conn.go#L36: func (cn *Conn) UsedAt() time.Time {
conn.go#L41: func (cn *Conn) SetUsedAt(tm time.Time) {
conn.go#L45: func (cn *Conn) RemoteAddr() net.Addr {
conn.go#L49: func (cn *Conn) SetNetConn(netConn net.Conn) {
conn.go#L56: func (cn *Conn) LockReader() {
conn.go#L64: func (cn *Conn) NetConn() net.Conn {
conn.go#L68: func (cn *Conn) NextID() string {
conn.go#L73: func (cn *Conn) WithReader(
conn.go#L97: func (cn *Conn) WithWriter(
conn.go#L110: func (cn *Conn) WriteBuffer(ctx context.Context, timeout time.Duration, wb *WriteBuffer) error {
conn.go#L114: func (cn *Conn) writeBuffer(
conn.go#L128: func (cn *Conn) Close() error {
conn.go#L132: func (cn *Conn) deadline(ctx context.Context, timeout time.Duration) time.Time {
pool.go#L39: NewConn(context.Context) (*Conn, error)
pool.go#L40: CloseConn(*Conn) error
pool.go#L42: Get(context.Context) (*Conn, error)
pool.go#L43: Put(context.Context, *Conn)
pool.go#L44: Remove(context.Context, *Conn, error)
pool.go#L55: OnClose func(*Conn) error
pool.go#L80: conns []*Conn
pool.go#L81: idleConns []*Conn
pool.go#L94: conns: make([]*Conn, 0, opt.PoolSize),
pool.go#L95: idleConns: make([]*Conn, 0, opt.PoolSize),
pool.go#L141: func (p *ConnPool) NewConn(c context.Context) (*Conn, error) {
pool.go#L145: func (p *ConnPool) newConn(c context.Context, pooled bool) (*Conn, error) {
pool.go#L167: func (p *ConnPool) dialConn(c context.Context, pooled bool) (*Conn, error) {
pool.go#L223: func (p *ConnPool) Get(ctx context.Context) (*Conn, error) {
pool.go#L306: func (p *ConnPool) popIdle() *Conn {
pool.go#L319: func (p *ConnPool) Put(ctx context.Context, cn *Conn) {
pool.go#L332: func (p *ConnPool) Remove(ctx context.Context, cn *Conn, reason error) {
pool.go#L338: func (p *ConnPool) CloseConn(cn *Conn) error {
pool.go#L343: func (p *ConnPool) removeConnWithLock(cn *Conn) {
pool.go#L349: func (p *ConnPool) removeConn(cn *Conn) {
pool.go#L362: func (p *ConnPool) closeConn(cn *Conn) error {
pool.go#L402: func (p *ConnPool) Filter(fn func(*Conn) bool) error {
pool.go#L475: func (p *ConnPool) reapStaleConn() *Conn {
pool.go#L492: func (p *ConnPool) isStaleConn(cn *Conn) bool {
pool_single.go#L7: cn *Conn
pool_single.go#L13: func NewSingleConnPool(pool Pooler, cn *Conn) *SingleConnPool {
pool_single.go#L20: func (p *SingleConnPool) NewConn(ctx context.Context) (*Conn, error) {
pool_single.go#L24: func (p *SingleConnPool) CloseConn(cn *Conn) error {
pool_single.go#L28: func (p *SingleConnPool) Get(ctx context.Context) (*Conn, error) {
pool_single.go#L35: func (p *SingleConnPool) Put(ctx context.Context, cn *Conn) {}
pool_single.go#L37: func (p *SingleConnPool) Remove(ctx context.Context, cn *Conn, reason error) {
pool_sticky.go#L41: ch chan *Conn
pool_sticky.go#L53: ch: make(chan *Conn, 1),
pool_sticky.go#L60: func (p *StickyConnPool) NewConn(ctx context.Context) (*Conn, error) {
pool_sticky.go#L64: func (p *StickyConnPool) CloseConn(cn *Conn) error {
pool_sticky.go#L68: func (p *StickyConnPool) Get(ctx context.Context) (*Conn, error) {
pool_sticky.go#L99: func (p *StickyConnPool) Put(ctx context.Context, cn *Conn) {
pool_sticky.go#L108: func (p *StickyConnPool) freeConn(ctx context.Context, cn *Conn) {
pool_sticky.go#L116: func (p *StickyConnPool) Remove(ctx context.Context, cn *Conn, reason error) {
github.com/go-pg/pg/v10
base.go#L74: func (db *baseDB) getConn(ctx context.Context) (*pool.Conn, error) {
base.go#L99: func (db *baseDB) initConn(ctx context.Context, cn *pool.Conn) error {
base.go#L125: func (db *baseDB) releaseConn(ctx context.Context, cn *pool.Conn, err error) {
base.go#L140: ctx context.Context, fn func(context.Context, *pool.Conn) error,
base.go#L251: lastErr = db.withConn(ctx, func(ctx context.Context, cn *pool.Conn) error {
base.go#L321: lastErr = db.withConn(ctx, func(ctx context.Context, cn *pool.Conn) error {
base.go#L364: err = db.withConn(c, func(c context.Context, cn *pool.Conn) error {
base.go#L373: ctx context.Context, cn *pool.Conn, r io.Reader, query interface{}, params ...interface{},
base.go#L447: err = db.withConn(c, func(c context.Context, cn *pool.Conn) error {
base.go#L455: ctx context.Context, cn *pool.Conn, w io.Writer, query interface{}, params ...interface{},
base.go#L544: c context.Context, cn *pool.Conn, wb *pool.WriteBuffer,
base.go#L563: c context.Context, cn *pool.Conn, model interface{}, wb *pool.WriteBuffer,
base.go#L589: c context.Context, cn *pool.Conn, q string,
base.go#L612: func (db *baseDB) closeStmt(c context.Context, cn *pool.Conn, name string) error {
listener.go#L38: cn *pool.Conn
listener.go#L58: func (ln *Listener) connWithLock(ctx context.Context) (*pool.Conn, error) {
listener.go#L77: func (ln *Listener) conn(ctx context.Context) (*pool.Conn, error) {
listener.go#L110: func (ln *Listener) releaseConn(ctx context.Context, cn *pool.Conn, err error, allowTimeout bool) {
listener.go#L172: func (ln *Listener) listen(ctx context.Context, cn *pool.Conn, channels ...string) error {
listener.go#L205: func (ln *Listener) unlisten(ctx context.Context, cn *pool.Conn, channels ...string) error {
messages.go#L79: c context.Context, cn *pool.Conn, user, password, database, appName string,
messages.go#L142: func (db *baseDB) enableSSL(c context.Context, cn *pool.Conn, tlsConf *tls.Config) error {
messages.go#L170: c context.Context, cn *pool.Conn, rd *pool.ReaderContext, user, password string,
messages.go#L237: c context.Context, cn *pool.Conn, rd *pool.ReaderContext, password string,
messages.go#L250: c context.Context, cn *pool.Conn, rd *pool.ReaderContext, user, password string,
messages.go#L297: c context.Context, cn *pool.Conn, rd *pool.ReaderContext, user, password string,
messages.go#L1324: func terminateConn(cn *pool.Conn) error {
stmt.go#L55: lastErr = stmt.withConn(ctx, func(ctx context.Context, cn *pool.Conn) error {
stmt.go#L67: func (stmt *Stmt) withConn(c context.Context, fn func(context.Context, *pool.Conn) error) error {
stmt.go#L104: lastErr = stmt.withConn(ctx, func(c context.Context, cn *pool.Conn) error {
stmt.go#L169: lastErr = stmt.withConn(ctx, func(c context.Context, cn *pool.Conn) error {
stmt.go#L230: c context.Context, cn *pool.Conn, name string, params ...interface{},
stmt.go#L253: cn *pool.Conn,
stmt.go#L279: return stmt.withConn(context.TODO(), func(c context.Context, cn *pool.Conn) error {
tx.go#L104: func (tx *Tx) withConn(c context.Context, fn func(context.Context, *pool.Conn) error) error {
tx.go#L166: lastErr := tx.withConn(ctx, func(ctx context.Context, cn *pool.Conn) error {
tx.go#L233: lastErr := tx.withConn(ctx, func(ctx context.Context, cn *pool.Conn) error {
tx.go#L293: err = tx.withConn(tx.ctx, func(c context.Context, cn *pool.Conn) error {
tx.go#L302: err = tx.withConn(tx.ctx, func(c context.Context, cn *pool.Conn) error {