Documentation
¶
Index ¶
- Variables
- type RedisClient
- func (r *RedisClient) Check() error
- func (r *RedisClient) Close()
- func (r *RedisClient) GetConnection(dbName ...string) (redis.UniversalClient, error)
- func (r *RedisClient) Init(redisConfigData []byte)
- func (r *RedisClient) InitWithError(redisConfigData []byte) error
- func (r *RedisClient) IsMultiDB() bool
- func (r *RedisClient) ListConnNames() []string
- func (r *RedisClient) PSubscribe(dbName string, handler func(msg *redis.Message, dbName string), ...)
- func (r *RedisClient) PSubscribeContext(ctx context.Context, dbName string, ...)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrClosed = errors.New("redis client is closed")
View Source
var Redis = &RedisClient{}
Functions ¶
This section is empty.
Types ¶
type RedisClient ¶
type RedisClient struct {
// contains filtered or unexported fields
}
func (*RedisClient) Check ¶
func (r *RedisClient) Check() error
func (*RedisClient) Close ¶
func (r *RedisClient) Close()
func (*RedisClient) GetConnection ¶
func (r *RedisClient) GetConnection(dbName ...string) (redis.UniversalClient, error)
func (*RedisClient) Init ¶
func (r *RedisClient) Init(redisConfigData []byte)
func (*RedisClient) InitWithError ¶ added in v2.0.18
func (r *RedisClient) InitWithError(redisConfigData []byte) error
func (*RedisClient) IsMultiDB ¶
func (r *RedisClient) IsMultiDB() bool
func (*RedisClient) ListConnNames ¶
func (r *RedisClient) ListConnNames() []string
func (*RedisClient) PSubscribe ¶
func (r *RedisClient) PSubscribe(dbName string, handler func(msg *redis.Message, dbName string), channels ...string)
PSubscribe 订阅消息并自动重连
func (*RedisClient) PSubscribeContext ¶ added in v2.0.18
func (r *RedisClient) PSubscribeContext(ctx context.Context, dbName string, handler func(msg *redis.Message, dbName string), channels ...string)
PSubscribeContext subscribes to channels and stops retrying when ctx is canceled.
Click to show internal directories.
Click to hide internal directories.