Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitMySqlDatabase ¶
func InitMySqlDatabase(cfg *MysqlConfig, dbInstance ...string)
InitMySqlDatabase 初始化mysql数据库数据库连接
Types ¶
type MysqlClusterConfig ¶
type MysqlClusterConfig struct { MysqlSingleConfig Master []MysqlSingleConfig `json:"master"` Slave []MysqlSingleConfig `json:"slave"` }
type MysqlConfig ¶
type MysqlConfig struct { Cluster bool `json:"cluster"` Options MysqlClusterConfig `json:"options"` }
mysql 数据库配置
type MysqlSingleConfig ¶
type MysqlSingleConfig struct { Charset string `json:"charset"` ParseTime bool `json:"parse_time"` Protocol string `json:"protocol"` Host string `json:"host"` Port int `json:"port"` User string `json:"user"` Password string `json:"password"` Prefix string `json:"prefix"` DB string `json:"db"` MaxOpenCons int `json:"max_open_cons"` MaxIdleCons int `json:"max_idle_cons"` }
Click to show internal directories.
Click to hide internal directories.