Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitRedis ¶
func InitRedis(cfg RedisConfig) (*redis.Client, error)
Types ¶
type MysqlConfig ¶
type MysqlConfig struct { Service string `yaml:"service"` // 服务名 Addr string `yaml:"addr"` // 地址 Database string `yaml:"database"` // 数据库名 User string `yaml:"user"` // 用户名 Password string `yaml:"password"` // 密码 Charset string `yaml:"charset"` // 字符集 Timeout time.Duration `yaml:"timeout"` // 连接超时 ReadTimeout time.Duration `yaml:"read_timeout"` // 读取超时 WriteTimeout time.Duration `yaml:"write_timeout"` // 写入超时 SlowThreshold time.Duration `yaml:"slow_threshold"` // 慢SQL阈值 MaxSqlLen int `yaml:"max_sql_len"` // 日志最大SQL长度 }
type RedisConfig ¶
type RedisConfig struct { Service string `yaml:"service"` // 服务名 Addr string `yaml:"addr"` // redis地址 Password string `yaml:"password"` // 密码 DB int `yaml:"db"` // 数据库 DialTimeout time.Duration `yaml:"dial_timeout"` // 连接超时 ReadTimeout time.Duration `yaml:"read_timeout"` // 读取超时 WriteTimeout time.Duration `yaml:"write_timeout"` // 写入超时 }
Click to show internal directories.
Click to hide internal directories.