mysql

package
v0.0.0-...-dc66ec4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2019 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MYSQL_SESSION_NIL_ERR        = errors.New("MysqlMgr session nil.")
	MYSQL_GET_NAMED_RESULT_ERROR = errors.New("Mysql GetResult Type Error")
)

Functions

This section is empty.

Types

type MysqlConnInfo

type MysqlConnInfo struct {
	*mysql.Config
}

func NewMysqlConnInfo

func NewMysqlConnInfo(host string, port int, name, user, pass string) *MysqlConnInfo

func (*MysqlConnInfo) String

func (mi *MysqlConnInfo) String() string

type MysqlMgr

type MysqlMgr struct {
	// contains filtered or unexported fields
}

func NewMysqlMgr

func NewMysqlMgr(dbcfg *MysqlConnInfo, timeout time.Duration) *MysqlMgr

func (*MysqlMgr) Close

func (mgr *MysqlMgr) Close()

func (*MysqlMgr) GetNamedRows

func (mgr *MysqlMgr) GetNamedRows(query interface{}) ([]map[string]interface{}, error)

GetNamedRows 解析查询返回的数据

func (*MysqlMgr) GetSession

func (mgr *MysqlMgr) GetSession() *sql.DB

func (*MysqlMgr) Ping

func (mgr *MysqlMgr) Ping() error

func (*MysqlMgr) Start

func (mgr *MysqlMgr) Start() error

Start 连接mysql

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL