package config import ( "fmt" "github.com/zeromicro/go-zero/zrpc" ) // MySQL 数据库配置 type MySQLConf struct { Host string Port int User string Password string DBName string MaxIdleConns int MaxOpenConns int } func (m MySQLConf) DSN() string { return fmt.Sprintf("%s:%s@tcp(%s:%d)/%s?charset=utf8mb4&parseTime=True&loc=Local", m.User, m.Password, m.Host, m.Port, m.DBName) } type RedisGoConf struct { Host string Port int Pass string DB int } type Config struct { zrpc.RpcServerConf MySQL MySQLConf RedisGo RedisGoConf AuthRpc struct { AccessSecret string AccessExpire int64 } TkStore bool }