Documentation ¶ Index ¶ func NewMysql(config DatabaseConfig) (*gorm.DB, error) func NewRedis(config RedisConfig) (*redis.Client, error) type DatabaseConfig type Logger func NewLogger(logPath, module string, debug bool) (*Logger, error) type RedisConfig Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func NewMysql ¶ func NewMysql(config DatabaseConfig) (*gorm.DB, error) NewMysql 数据库连接 func NewRedis ¶ func NewRedis(config RedisConfig) (*redis.Client, error) NewRedis redis连接 Types ¶ type DatabaseConfig ¶ type DatabaseConfig struct { Host string Port string User string Pass string DbName string Prefix string MaxIdleConns int MaxOpenConns int MaxLifeTime int // 分钟 } type Logger ¶ type Logger struct { *logrus.Logger } func NewLogger ¶ func NewLogger(logPath, module string, debug bool) (*Logger, error) NewLogger 构造日志服务 type RedisConfig ¶ type RedisConfig struct { Addr string Password string DbNum int } Source Files ¶ View all Source files logger.gomysql.goredis.go Click to show internal directories. Click to hide internal directories.