Documentation ¶
Index ¶
- func Publish(ctx context.Context, cli interface{}, clusterFlag bool, ...) error
- func Subscrible(ctx context.Context, cli interface{}, clusterFlag bool, cb SubscriberCallback, ...) error
- type RedisClient
- func (cli *RedisClient) Bpop(mqName []string, timeout uint32) (string, error)
- func (cli *RedisClient) CheckRedisConPeriod()
- func (cli *RedisClient) Close() error
- func (cli *RedisClient) Connect() error
- func (cli *RedisClient) GetKeys(pattern string) ([]string, error)
- func (cli *RedisClient) HKeys(hashMapName string) ([]string, error)
- func (cli *RedisClient) HVals(hashMapName string) ([]string, error)
- func (cli *RedisClient) Hdel(hashMapName, key string) error
- func (cli *RedisClient) Hget(hashMapName, key string) (string, error)
- func (cli *RedisClient) Hmget(hashMapName string, keys []string) ([]string, error)
- func (cli *RedisClient) Hset(hashMapName, key, value string) error
- func (cli *RedisClient) Lock(key, value string, lifeTime uint64) error
- func (cli *RedisClient) Pop(mqName string) (string, error)
- func (cli *RedisClient) Push(mqName, message string) error
- func (cli *RedisClient) Sadd(key, value string) error
- func (cli *RedisClient) Smembers(key string) ([]string, error)
- func (cli *RedisClient) Srem(key, value string) error
- func (cli *RedisClient) UnLock(key string) error
- type RedisConfig
- type SubscriberCallback
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Publish ¶
func Publish(ctx context.Context, cli interface{}, clusterFlag bool, channelName, message string) error
Publish publish to redis
func Subscrible ¶
func Subscrible(ctx context.Context, cli interface{}, clusterFlag bool, cb SubscriberCallback, channelName ...string) error
Subscrible subscribe
Types ¶
type RedisClient ¶
type RedisClient struct { RedisCfg []RedisConfig // contains filtered or unexported fields }
func NewClient ¶
func NewClient(cfg []RedisConfig) (*RedisClient, error)
func (*RedisClient) Bpop ¶
func (cli *RedisClient) Bpop(mqName []string, timeout uint32) (string, error)
阻塞式从队列首读取一个元素,支持多个队列设置优先级
func (*RedisClient) CheckRedisConPeriod ¶
func (cli *RedisClient) CheckRedisConPeriod()
func (*RedisClient) Close ¶
func (cli *RedisClient) Close() error
func (*RedisClient) Connect ¶
func (cli *RedisClient) Connect() error
func (*RedisClient) Hdel ¶
func (cli *RedisClient) Hdel(hashMapName, key string) error
func (*RedisClient) Hmget ¶
func (cli *RedisClient) Hmget(hashMapName string, keys []string) ([]string, error)
func (*RedisClient) Hset ¶
func (cli *RedisClient) Hset(hashMapName, key, value string) error
func (*RedisClient) Push ¶
func (cli *RedisClient) Push(mqName, message string) error
func (*RedisClient) Sadd ¶
func (cli *RedisClient) Sadd(key, value string) error
func (*RedisClient) Srem ¶
func (cli *RedisClient) Srem(key, value string) error
func (*RedisClient) UnLock ¶
func (cli *RedisClient) UnLock(key string) error
type RedisConfig ¶
type SubscriberCallback ¶
type SubscriberCallback func(channel, message string)
SubscriberCallback subscriber callback function
Click to show internal directories.
Click to hide internal directories.