Documentation ¶
Index ¶
- Constants
- Variables
- type BackendConn
- type Conn
- func (c *Conn) Begin() error
- func (c *Conn) Close() error
- 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) error
- func (c *Conn) UseDB(dbName string) error
- type DB
- func (db *DB) Addr() string
- func (db *DB) Close() error
- func (db *DB) GetConn() (*BackendConn, error)
- func (db *DB) GetConnFromCache(cacheConns chan *Conn) *Conn
- func (db *DB) GetConnFromIdle(cacheConns, idleConns chan *Conn) (*Conn, error)
- func (db *DB) IdleConnCount() int
- func (db *DB) Ping() error
- func (db *DB) PopConn() (*Conn, error)
- func (db *DB) PushConn(co *Conn, err error)
- func (db *DB) State() string
- type Stmt
Constants ¶
View Source
const ( Up = iota Down ManualDown Unknown InitConnCount = 1 DefaultMaxConnNum = 1024 PingPeroid int64 = 8 )
Variables ¶
View Source
var ( ErrDatabaseClose = errors.New("database is close") ErrConnIsNil = errors.New("connection is nil") ErrBadConn = errors.New("connection was bad") )
errors
Functions ¶
This section is empty.
Types ¶
type BackendConn ¶
type BackendConn struct { *Conn // contains filtered or unexported fields }
func (*BackendConn) Close ¶
func (p *BackendConn) Close()
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn is a mysql clinet to server connection.
func (*Conn) ClosePrepare ¶
func (*Conn) GetCharset ¶
func (*Conn) IsAutoCommit ¶
func (*Conn) IsInTransaction ¶
func (*Conn) SetAutoCommit ¶
func (*Conn) SetCharset ¶
type DB ¶
func (*DB) GetConn ¶
func (db *DB) GetConn() (*BackendConn, error)
func (*DB) GetConnFromCache ¶
func (*DB) GetConnFromIdle ¶
func (*DB) IdleConnCount ¶
Click to show internal directories.
Click to hide internal directories.