feat: 优化redis日志实例的注入方式

This commit is contained in:
2025-12-31 16:57:25 +08:00
parent 5fa6e8118b
commit 147b12cddf
3 changed files with 29 additions and 23 deletions

View File

@@ -7,7 +7,10 @@
// Date : 2024-06-18 16:12
package define
import redisClient "github.com/redis/go-redis/v9"
import (
redisClient "github.com/redis/go-redis/v9"
"go.uber.org/zap"
)
type Options struct {
DB int `json:"db" yaml:"db" ini:"db" toml:"db"` // 选择的数据库序号
@@ -61,6 +64,7 @@ type Config struct {
//
// Date : 16:06 2024/10/8
type ClientInfo struct {
Logger *zap.Logger // 日志实例
ReadOnly bool // 是否只读
Master *redisClient.Client // 主库连接
Slave *redisClient.Client // 从库连接