redis.go 512 字节
Newer Older
Y
Your Name 已提交
1
package redis_manager
E
eoLinker API Management 已提交
2

黄孟柱 已提交
3
import "github.com/go-redis/redis"
E
eoLinker API Management 已提交
4 5

const (
Y
Your Name 已提交
6 7 8 9
	//RedisModeCluster cluster模式
	RedisModeCluster = "cluster"
	//RedisModeStand stand模式
	RedisModeStand = "stand"
E
eoLinker API Management 已提交
10 11
)

Y
Your Name 已提交
12
//Redis redis接口
E
eoLinker API Management 已提交
13 14 15 16
type Redis interface {
	redis.Cmdable
	GetConfig() RedisConfig
	//Foreach(fn func(client *localRedis.Client) error) error
Y
Your Name 已提交
17
	Nodes() []string
E
eoLinker API Management 已提交
18 19
}

Y
Your Name 已提交
20
//RedisConfig redis配置
E
eoLinker API Management 已提交
21 22 23 24 25 26 27
type RedisConfig interface {
	GetMode() string
	GetAddrs() []string
	GetMasters() []string
	GetDbIndex() int
	GetPassword() string
}