mirror of
https://github.com/eosswedenorg/thalos
synced 2026-06-17 04:30:03 +02:00
17 lines
288 B
Go
17 lines
288 B
Go
package redis
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/go-redis/redis/v8"
|
|
)
|
|
|
|
func NewClient(cfg Config) (*redis.Client, error) {
|
|
rdb := redis.NewClient(&redis.Options{
|
|
Addr: cfg.Addr,
|
|
Password: cfg.Password,
|
|
DB: cfg.DB,
|
|
})
|
|
|
|
return rdb, rdb.Ping(context.Background()).Err()
|
|
}
|