Documentation ¶
Index ¶
- Constants
- Variables
- func Gcd(ary []int) int
- type Conn
- func (c *Conn) Begin() error
- func (c *Conn) Close()
- func (c *Conn) ClosePrepare(id uint32) error
- func (c *Conn) Commit() error
- func (c *Conn) Connect(addr string, user string, password string, db string) error
- func (c *Conn) Execute(command string, args ...interface{}) (*mysql.Result, error)
- func (c *Conn) FieldList(table string, wildcard string) ([]*mysql.Field, error)
- func (c *Conn) GetAddr() string
- func (c *Conn) GetCharset() string
- func (c *Conn) GetDB() string
- func (c *Conn) IsAutoCommit() bool
- func (c *Conn) IsInTransaction() bool
- func (c *Conn) Ping() error
- func (c *Conn) Prepare(query string) (*Stmt, error)
- func (c *Conn) ReConnect() error
- func (c *Conn) Rollback() error
- func (c *Conn) SetAutoCommit(n uint8) error
- func (c *Conn) SetCharset(charset string, collation mysql.CollationId) error
- func (c *Conn) UseDB(dbName string) error
- type DB
- type DbOption
- type Option
- type Stmt
Constants ¶
View Source
const ( Up = iota Down ManualDown Unknown PingPeroid int64 = 4 )
View Source
const ( DefaultCapacity = 128 DefaultMaxCapacity = 1024 )
Variables ¶
View Source
var ( DefaultOption = &Option{ idleTimeout: defaultIdleTimeout, connTimeout: defaultConnTimeout, maxCapacity: DefaultMaxCapacity, capacity: DefaultCapacity, charset: mysql.DEFAULT_CHARSET, collationId: mysql.DEFAULT_COLLATION_ID, } )
View Source
var ( // ErrConnectionPoolClosed means pool closed error ErrConnectionPoolClosed = errors.New("connection pool is closed") )
Functions ¶
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
proxy <-> mysql server
func (*Conn) ClosePrepare ¶
func (*Conn) GetCharset ¶
func (*Conn) IsAutoCommit ¶
func (*Conn) IsInTransaction ¶
func (*Conn) SetAutoCommit ¶
func (*Conn) SetCharset ¶
func (c *Conn) SetCharset(charset string, collation mysql.CollationId) error
type DB ¶
type DB struct { sync.RWMutex *resource_polll.ResourcePool // contains filtered or unexported fields }
type DbOption ¶
type DbOption func(o *Option)
func WithCapacity ¶
func WithCharSet ¶
func WithCollationId ¶
func WithCollationId(ci mysql.CollationId) DbOption
func WithConnTimeout ¶
func WithIdleTimeout ¶
func WithMaxCapacity ¶
Click to show internal directories.
Click to hide internal directories.