Documentation
¶
Index ¶
- Variables
- func GetClient(poolName string) (c interface{}, err error)
- func IsRegister(poolName string) (ok bool)
- func PutClient(poolName string, c interface{}) (err error)
- func RegisterClickPool(poolName string, url string, force bool, params ...int) (err error)
- func RegisterMgoPool(poolName string, url string, force bool, params ...int) (err error)
- func RegisterPool(poolName string, p Pooler, force bool, params ...int) (err error)
- func ReleaseAll()
- func ReleasePool(poolName string)
- type ClickConn
- type Config
- type DriverType
- type MgoConn
- type Pool
- type Pooler
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func IsRegister ¶
func RegisterClickPool ¶
func RegisterMgoPool ¶
func RegisterPool ¶
func ReleaseAll ¶
func ReleaseAll()
func ReleasePool ¶
func ReleasePool(poolName string)
Types ¶
type Config ¶
type Config struct { //连接池中拥有的最小连接数 InitialCap int //连接池中拥有的最大的连接数 MaxCap int //生成连接的方法 Factory func() (interface{}, error) //关闭连接的方法 Close func(interface{}) error //检查连接是否有效的方法 Ping func(interface{}) error //连接最大空闲时间,超过该事件则将失效 IdleTimeout time.Duration }
Config 连接池相关配置
type DriverType ¶
type DriverType int
Click to show internal directories.
Click to hide internal directories.