package
0.0.0-20220627031353-e67e585862f7
Repository: https://github.com/alwaysthanks/gopool.git
Documentation: pkg.go.dev
# README
gopool usage example
A golang universal connection pool.
Usage
Note: you need to implement the conn.go interface firstly, a specific implementation demo example in package connimpl, and see main.go for how to use it
//init pool
if err := connimpl.Init(); err != nil {
}
defer connimpl.Close()
//get connection from pool by biz key
conn, err := connimpl.GetConn(connimpl.KeyBizDemo1)
if err != nil {
//handle error
}
//do your business
//....
var bizErr error
//*grpc.ClientConn
conn.Ins()
//....
//release connection to the pool
connimpl.PutConn(conn, bizErr)
# Packages
No description provided by the author