17 lines
305 B
Go
17 lines
305 B
Go
|
package redis
|
||
|
|
||
|
import "github.com/redis/go-redis/v9"
|
||
|
|
||
|
func InitDefaultRedis() (*redis.Client, error) {
|
||
|
opt, err := LoadDefaultConfig()
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
rdb := redis.NewClient(&redis.Options{
|
||
|
Addr: opt.Addr,
|
||
|
Password: opt.Password,
|
||
|
DB: opt.DB,
|
||
|
})
|
||
|
return rdb, nil
|
||
|
}
|