package redisaccessor

import (
	"legalgo-BE-go/config"

	"github.com/redis/go-redis/v9"
)

var redisClient *redis.Client

func Get() *redis.Client {
	return redisClient
}

func New() *redis.Client {
	redisClient = redis.NewClient(&redis.Options{
		Username: config.REDIS_USERNAME,
		Addr:     config.REDIS_ADDR,
		Password: config.REDIS_PASSWORD,
		DB:       config.REDIS_DB,
	})

	return redisClient
}
