Documentation ¶
Index ¶
- func GenLockKey(key string) string
- func HealthCheck() error
- func Init()
- func InitByCfg(cfg map[string]RedisCfgArr)
- func InitByData(data []byte)
- func InitByFile(fileName string)
- func Lock(key string, lockSec int, conn *RedisConn) bool
- func Unlock(key string, conn *RedisConn)
- type RedisCfg
- type RedisCfgArr
- type RedisConn
- type RedisMgr
- type RedisPool
- type RedisPools
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenLockKey ¶
func HealthCheck ¶
func HealthCheck() error
func InitByCfg ¶
func InitByCfg(cfg map[string]RedisCfgArr)
func InitByData ¶
func InitByData(data []byte)
func InitByFile ¶
func InitByFile(fileName string)
Types ¶
type RedisCfg ¶
type RedisCfg struct { Addr string `json:"address"` Port int `json:"port"` Pwd string `json:"pwd"` MaxIdle int `json:"maxIdle"` MaxTotal int `json::maxTotal"` }
redis config
type RedisCfgArr ¶
type RedisMgr ¶
type RedisMgr struct { Cfgs map[string]RedisCfgArr MapPools map[string]RedisPools }
func NewRedisMgr ¶
func NewRedisMgr() *RedisMgr
func (*RedisMgr) GetRedisPools ¶
func (this *RedisMgr) GetRedisPools(name string) *RedisPools
func (*RedisMgr) HealthCheck ¶
func (*RedisMgr) InitByCfg ¶
func (this *RedisMgr) InitByCfg(cfg map[string]RedisCfgArr)
func (*RedisMgr) InitByData ¶
func (*RedisMgr) InitByFile ¶
type RedisPool ¶
func CreatePools ¶
func CreateRedisPool ¶
func CreateRedisPoolByCfg ¶
func CreateRedisPoolByFile ¶
type RedisPools ¶
type RedisPools []*RedisPool
func GetRedisPools ¶
func GetRedisPools(name string) *RedisPools
func (RedisPools) GetConn ¶
func (this RedisPools) GetConn() *RedisConn
func (RedisPools) GetConnByIndex ¶
func (this RedisPools) GetConnByIndex(index int) *RedisConn
func (RedisPools) GetConnByRand ¶
func (this RedisPools) GetConnByRand() *RedisConn
Click to show internal directories.
Click to hide internal directories.