goshorly/db/connection.go
2022-12-23 23:07:00 +01:00

23 lines
449 B
Go

package db
import (
"context"
"gitea.hackmi.ch/Phil/goshorly/utils"
"github.com/go-redis/redis/v8"
)
var ctx = context.Background()
func Client_redis() *redis.Client {
var Client *redis.Client = redis.NewClient(&redis.Options{
Addr: utils.REDIS_URI, // use default Addr
Password: "", // no password set
DB: 0, // use default DB
})
return Client
}
func Init_redis() {
Client_redis().Ping(ctx)
}