Documentation ¶
Index ¶
- func SetRedisInstance(dbName string, instance []RedisInstance)
- type RedisInstance
- func (r *RedisInstance) Decr(ctx context.Context, key string) (int64, error)
- func (r *RedisInstance) DecrBy(ctx context.Context, key string, decrAmount int64) (int64, error)
- func (r *RedisInstance) Del(ctx context.Context, key string) error
- func (r *RedisInstance) Expire(ctx context.Context, key string, expire int) error
- func (r *RedisInstance) Get(ctx context.Context, key string) (string, error)
- func (r *RedisInstance) GetString(ctx context.Context, key string) (string, error)
- func (r *RedisInstance) Hdel(ctx context.Context, key, field string) (int64, error)
- func (r *RedisInstance) Hget(ctx context.Context, key, field string) (string, error)
- func (r *RedisInstance) Hgetall(ctx context.Context, key string) (map[string]string, error)
- func (r *RedisInstance) Hincrby(ctx context.Context, key, field string, incrAmount int64) (int64, error)
- func (r *RedisInstance) Hkeys(ctx context.Context, key string) ([]string, error)
- func (r *RedisInstance) Hlen(ctx context.Context, key string) (int64, error)
- func (r *RedisInstance) Hset(ctx context.Context, key, field string, val interface{}) (int64, error)
- func (r *RedisInstance) Incr(ctx context.Context, key string) (int64, error)
- func (r *RedisInstance) IncrBy(ctx context.Context, key string, value int64) (int64, error)
- func (r *RedisInstance) Llen(ctx context.Context, key string) (int64, error)
- func (r *RedisInstance) Lpop(ctx context.Context, key string) (string, error)
- func (r *RedisInstance) Lpush(ctx context.Context, key string, val interface{}) (int64, error)
- func (r *RedisInstance) Lrem(ctx context.Context, key string, val interface{}, count int64) (int64, error)
- func (r *RedisInstance) Pub(ctx context.Context, channel string, msg string) (int64, error)
- func (r *RedisInstance) Rpop(ctx context.Context, key string) (string, error)
- func (r *RedisInstance) SAdd(ctx context.Context, key string, value string) (int64, error)
- func (r *RedisInstance) SMembers(ctx context.Context, key string) ([]string, error)
- func (r *RedisInstance) SRANDMEMBER(ctx context.Context, key string) (string, error)
- func (r *RedisInstance) Set(ctx context.Context, key string, val interface{}, expire int) (string, error)
- func (r *RedisInstance) SetNx(ctx context.Context, key string, val interface{}, expire int) (bool, error)
- func (r *RedisInstance) SetNxEx(ctx context.Context, key string, val interface{}, expire int) (string, error)
- func (r *RedisInstance) SetString(ctx context.Context, key string, value string) (string, error)
- func (r *RedisInstance) Sub(ctx context.Context, consumeFunc func(data *redis.Message) error, ...) error
- func (r *RedisInstance) Ttl(ctx context.Context, key string) (int64, error)
- func (r *RedisInstance) Zadd(ctx context.Context, key string, score float64, member interface{}) (int64, error)
- func (r *RedisInstance) Zrangebyscore(ctx context.Context, key, min, max string) ([]string, error)
- func (r *RedisInstance) Zrevrange(ctx context.Context, key string, start, stop int64) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetRedisInstance ¶
func SetRedisInstance(dbName string, instance []RedisInstance)
Types ¶
type RedisInstance ¶
func GetRedisInstance ¶
func GetRedisInstance(dbName string) (*RedisInstance, error)
func (*RedisInstance) SRANDMEMBER ¶
func (*RedisInstance) Set ¶
func (r *RedisInstance) Set(ctx context.Context, key string, val interface{}, expire int) (string, error)
Set 用法:Set("key", val, 60),其中 expire 的单位为秒
func (*RedisInstance) SetNxEx ¶
func (r *RedisInstance) SetNxEx(ctx context.Context, key string, val interface{}, expire int) (string, error)
SetNxEx exist set value + expires otherwise not do cmd: set key value ex 3600 nx
func (*RedisInstance) Zrangebyscore ¶
Click to show internal directories.
Click to hide internal directories.