topfans/backend/services/moderationService/client/redis_client.go
2026-06-22 17:19:48 +08:00

17 lines
326 B
Go

package client
import (
"fmt"
"github.com/redis/go-redis/v9"
)
// NewRedisClient 初始化 Redis 客户端
func NewRedisClient(host string, port int, password string, db int) *redis.Client {
return redis.NewClient(&redis.Options{
Addr: fmt.Sprintf("%s:%d", host, port),
Password: password,
DB: db,
})
}