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

import (
Y
Your Name 已提交
4
	redis_manager "github.com/eolinker/goku-api-gateway/common/redis-manager"
Y
Your Name 已提交
5
	goku_plugin "github.com/eolinker/goku-plugin"
E
eoLinker API Management 已提交
6 7
)

Y
Your Name 已提交
8
//Create 创建RedisManager
E
eoLinker API Management 已提交
9
func Create() goku_plugin.RedisManager {
Y
Your Name 已提交
10 11 12
	if redis_manager.GetConnection() == nil {
		return nil
	}
E
eoLinker API Management 已提交
13 14 15 16 17 18 19
	return &RedisManager{
		def: &RedisProxy{
			redisClient: redis_manager.GetConnection(),
		},
	}
}

Y
Your Name 已提交
20
//RedisManager RedisManager
E
eoLinker API Management 已提交
21 22 23 24
type RedisManager struct {
	def goku_plugin.Redis
}

Y
Your Name 已提交
25
//Default default
E
eoLinker API Management 已提交
26 27 28 29
func (m *RedisManager) Default() goku_plugin.Redis {
	return m.def
}

Y
Your Name 已提交
30
//Get get
E
eoLinker API Management 已提交
31 32 33
func (m *RedisManager) Get(name string) (redis goku_plugin.Redis, has bool) {
	panic("not implement")
}