package pool
import
type SingleConnPool struct {
pool Pooler
cn *Conn
stickyErr error
}
var _ Pooler = (*SingleConnPool)(nil)
func ( Pooler, *Conn) *SingleConnPool {
return &SingleConnPool{
pool: ,
cn: ,
}
}
func ( *SingleConnPool) ( context.Context) (*Conn, error) {
return .pool.NewConn()
}
func ( *SingleConnPool) ( *Conn) error {
return .pool.CloseConn()
}
func ( *SingleConnPool) ( context.Context) (*Conn, error) {
if .stickyErr != nil {
return nil, .stickyErr
}
return .cn, nil
}
func ( *SingleConnPool) ( context.Context, *Conn) {}
func ( *SingleConnPool) ( context.Context, *Conn, error) {
.cn = nil
.stickyErr =
}
func ( *SingleConnPool) () error {
.cn = nil
.stickyErr = ErrClosed
return nil
}
func ( *SingleConnPool) () int {
return 0
}
func ( *SingleConnPool) () int {
return 0
}
func ( *SingleConnPool) () *Stats {
return &Stats{}
}