pool

package
v0.0.0-...-b2d7ade Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn interface {
	Close()
}

type ConnPool

type ConnPool struct {
	// 创建连接对象的函数
	Dial func() (Conn, error)

	// 测试空闲连接对象健康情况
	TestOnBorrow func(c Conn, t time.Time) error

	MaxActive   int           // 允许最大连接数
	MaxIdle     int           // 允许最大空闲连接数
	IdleTimeout time.Duration // 空闲连接存活时间
	Wait        bool
	// contains filtered or unexported fields
}

func (*ConnPool) ActiveCount

func (p *ConnPool) ActiveCount() int

func (*ConnPool) Close

func (p *ConnPool) Close()

func (*ConnPool) Get

func (p *ConnPool) Get() (Conn, error)

func (*ConnPool) Put

func (p *ConnPool) Put(c Conn)

func (*ConnPool) Release

func (p *ConnPool) Release(conn Conn)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL