Documentation
¶
Index ¶
- Variables
- func SetLogger(info Logger)
- type DefaultLogger
- type Logger
- type PubSubHandle
- type RedisPool
- func (p *RedisPool) Close() (ok bool)
- func (p *RedisPool) Connect(redisServer string) (ok bool)
- func (p *RedisPool) GetNotifyConfig() (cfg string)
- func (p *RedisPool) IsConnected() (ok bool)
- func (p *RedisPool) Rdo(commandName string, args ...interface{}) (reply interface{}, err error)
- func (p *RedisPool) SetNotifyConfig(cfg string) (err error)
- func (p *RedisPool) Subscribe(topic string, isPattern ...bool) (err error)
- func (p *RedisPool) SubscribeHandle(handle PubSubHandle) (err error)
- func (p *RedisPool) UnSubscribe(topic string, isPattern ...bool) (err error)
- type RedisPoolX
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoConnection = errors.New("redisop: no connection") ErrNoSubscribe = errors.New("redisop: no subscribe") )
common errors
Functions ¶
Types ¶
type DefaultLogger ¶
type DefaultLogger struct { Level int // contains filtered or unexported fields }
DefaultLogger implement default logger interface
func NewDefaultLogger ¶
func NewDefaultLogger(level string) *DefaultLogger
NewDefaultLogger init new default logger
func (DefaultLogger) Debug ¶
func (l DefaultLogger) Debug(format string, v ...interface{})
Debug debug message
func (DefaultLogger) Info ¶
func (l DefaultLogger) Info(format string, v ...interface{})
Info info message
func (DefaultLogger) Warning ¶
func (l DefaultLogger) Warning(format string, v ...interface{})
Warning warning message
type Logger ¶
type Logger interface { Warning(format string, v ...interface{}) Info(format string, v ...interface{}) Debug(format string, v ...interface{}) }
Logger logger interface use by this lib
type PubSubHandle ¶
PubSubHandle 处理redis订阅消息
type RedisPool ¶
type RedisPool struct {
// contains filtered or unexported fields
}
RedisPool redis连接池
func (*RedisPool) GetNotifyConfig ¶
GetNotifyConfig 获取redis事件通知配置
func (*RedisPool) SetNotifyConfig ¶
SetNotifyConfig 设置redis事件通知配置
func (*RedisPool) SubscribeHandle ¶
func (p *RedisPool) SubscribeHandle(handle PubSubHandle) (err error)
SubscribeHandle 处理redis订阅消息
type RedisPoolX ¶
type RedisPoolX struct { RedisPool // contains filtered or unexported fields }
RedisPoolX 支持哨兵
func (*RedisPoolX) Sentinel ¶
func (p *RedisPoolX) Sentinel(servers, masterName string) (err error)
Sentinel 连接哨兵服务器
Click to show internal directories.
Click to hide internal directories.