Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFoundEngine = errors.New("not found sql engine")
)
Functions ¶
func InitMysql ¶
func InitMysql(confs map[string]MySqlConfig) error
Types ¶
type MySqlConfig ¶
type MySqlConfig struct { DBName string `toml:"db_name"` Host string `toml:"host"` Port int `toml:"port"` User string `toml:"user"` Passwd string `toml:"passwd"` ConnTimeout string `toml:"conn_timeout"` ReadTimeout string `toml:"read_timeout"` WriteTimeout string `toml:"write_timeout"` MaxConnNum int `toml:"max_conn_num"` MaxIdleConnNum int `toml:"max_idle_conn_num"` MaxConnLifeTime int `toml:"max_conn_life_time"` }
type MysqlEngine ¶
func GetMysqlEngine ¶
func GetMysqlEngine(db string) (*MysqlEngine, error)
func NewCustomMysqlEngine ¶
func (*MysqlEngine) Close ¶
func (mysql *MysqlEngine) Close()
Click to show internal directories.
Click to hide internal directories.