Documentation ¶
Overview ¶
Package gormcli 用于管理mysql连接
Index ¶
Constants ¶
View Source
const ( DEFAULT_MAX_CONN = 12000 DEFAULT_MAX_IDEL_CONN = 7000 DEFAULT_IDEL_TIMEOUT = 10 // use time.Second DEFAULT_READ_TIMEOUT = 10 DEFAULT_WRITE_TIMEOUT = 10 )
View Source
const (
GormDuplicateErrKey = "Duplicate entry"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GormFactory ¶
type GormFactory struct { MaxIdleConn int MaxConn int IdleTimeout int ReadTimeout int WriteTimeout int }
GormFactory 用来生成Gorm指针的工厂
var (
Factory GormFactory
)
func (*GormFactory) CreateGorm ¶
func (p *GormFactory) CreateGorm(user, pwd, url, database string) (*gorm.DB, error)
url like this : "127.0.0.1:3306"
Click to show internal directories.
Click to hide internal directories.