mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-20 17:57:54 +00:00
20 lines
341 B
Go
20 lines
341 B
Go
package config
|
|
|
|
import "github.com/spf13/viper"
|
|
|
|
type RedisConn struct {
|
|
Addr string
|
|
Password string
|
|
DB int
|
|
}
|
|
|
|
func InitRedisConn(cfg *viper.Viper) *RedisConn {
|
|
return &RedisConn{
|
|
Addr: cfg.GetString("addr"),
|
|
Password: cfg.GetString("password"),
|
|
DB: cfg.GetInt("db"),
|
|
}
|
|
}
|
|
|
|
var RedisConnConfig = new(RedisConn)
|