mysql

package
v0.0.0-...-04cfb28 Latest Latest
Warning

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

Go to latest
Published: May 22, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearTransaction

func ClearTransaction(tx *sql.Tx) error

Types

type Config

type Config struct {
	ID                string `json:"ID"`
	ConnString        string `json:"ConnString"` //user:password@tcp(localhost:5555)/dbname
	EncryptKey        string `json:"EncryptKey"`
	PoolSize          int    `json:"PoolSize"`
	IdleSize          int    `json:"IdleSize"`
	KeepaliveInterval int    `json:"KeepaliveInterval"`
	// contains filtered or unexported fields
}

type MgrConfig

type MgrConfig map[string]struct {
	Tags      []string
	Shardings []Config
}

type Mysql

type Mysql struct {
	Conf Config
	// contains filtered or unexported fields
}

func New

func New(conf Config) *Mysql

func (*Mysql) Close

func (msql *Mysql) Close() error

func (*Mysql) DB

func (msql *Mysql) DB() *sql.DB

func (*Mysql) OrmDB

func (msql *Mysql) OrmDB() *gorm.DB

type MysqlMgr

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

func NewMgr

func NewMgr(mgrConf MgrConfig) *MysqlMgr

func (*MysqlMgr) ForEach

func (mgr *MysqlMgr) ForEach(cb func(string, int, *Mysql))

func (*MysqlMgr) Get

func (mgr *MysqlMgr) Get(tag string, args ...interface{}) *Mysql

Jump to

Keyboard shortcuts

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