Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrClosed = errors.New("pool is closed")
)
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
InitialCap int // 连接池中拥有的初始连接数
MinCap int // 连接池中拥有的最小连接数
MaxCap int // 连接池中拥有的最大的连接数
Factory func() (interface{}, error) // 生成连接的方法
Close func(interface{}) error // 关闭连接的方法
Ping func(interface{}) bool // 检查连接是否有效的方法
Timeout time.Duration // 连接最大空闲时间,超过该事件则将失效
}
连接池配置类
Click to show internal directories.
Click to hide internal directories.