redis.go 359 B

12345678910111213141516
  1. package main
  2. import (
  3. "github.com/redis/go-redis/v9"
  4. )
  5. var RedisClient *redis.Client
  6. // initRedisClient is a function that takes a pointer to a RedisOptions struct and returns a pointer to a Redis client.
  7. func initRedisClient(options *redis.Options) {
  8. RedisClient = redis.NewClient(options)
  9. }
  10. func GetRedisClient() *redis.Client {
  11. return RedisClient
  12. }