Documentation ¶
Index ¶
- Constants
- type BitCountArgs
- type BoolCmd
- type DurationCmd
- type ErrorRedis
- type FloatCmd
- type IRedis
- type IntCmd
- type Redis
- func (c *Redis) Append(ctx context.Context, key, value string) *IntCmd
- func (c *Redis) BitCount(ctx context.Context, key string, bitCount *BitCountArgs) *IntCmd
- func (c *Redis) Decr(ctx context.Context, key string) *IntCmd
- func (c *Redis) DecrBy(ctx context.Context, key string, value int64) *IntCmd
- func (c *Redis) Del(ctx context.Context, keys ...string) *IntCmd
- func (c *Redis) Exists(ctx context.Context, keys ...string) *IntCmd
- func (c *Redis) Expire(ctx context.Context, key string, expiration time.Duration) *BoolCmd
- func (c *Redis) ExpireAt(ctx context.Context, key string, tm time.Time) *BoolCmd
- func (c *Redis) Get(ctx context.Context, key string) *StringCmd
- func (c *Redis) GetBit(ctx context.Context, key string, offset int64) *IntCmd
- func (c *Redis) GetRange(ctx context.Context, key string, start, end int64) *StringCmd
- func (c *Redis) GetSet(ctx context.Context, key string, value interface{}) *StringCmd
- func (c *Redis) HDel(ctx context.Context, key string, fields ...string) *IntCmd
- func (c *Redis) HExists(ctx context.Context, key, field string) *BoolCmd
- func (c *Redis) HGet(ctx context.Context, key, field string) *StringCmd
- func (c *Redis) HGetAll(ctx context.Context, key string) *StrStrMapCmd
- func (c *Redis) HIncrBy(ctx context.Context, key, field string, incrI64 int64) *IntCmd
- func (c *Redis) HIncrByFloat(ctx context.Context, key, field string, incrF64 float64) *FloatCmd
- func (c *Redis) HKeys(ctx context.Context, key string) *StrSliceCmd
- func (c *Redis) HLen(ctx context.Context, key string) *IntCmd
- func (c *Redis) HMGet(ctx context.Context, key string, fields ...string) *SliceCmd
- func (c *Redis) HMSet(ctx context.Context, key string, pairs ...interface{}) *StatusCmd
- func (c *Redis) HSet(ctx context.Context, key string, field string, value interface{}) *BoolCmd
- func (c *Redis) HSetNX(ctx context.Context, key, field string, value interface{}) *BoolCmd
- func (c *Redis) HVals(ctx context.Context, key string) *StrSliceCmd
- func (c *Redis) Incr(ctx context.Context, key string) *IntCmd
- func (c *Redis) IncrBy(ctx context.Context, key string, value int64) *IntCmd
- func (c *Redis) IncrByFloat(ctx context.Context, key string, value float64) *FloatCmd
- func (c *Redis) LIndex(ctx context.Context, key string, index int64) *StringCmd
- func (c *Redis) LInsert(ctx context.Context, key, op string, pivot, value interface{}) *IntCmd
- func (c *Redis) LLen(ctx context.Context, key string) *IntCmd
- func (c *Redis) LPop(ctx context.Context, key string) *StringCmd
- func (c *Redis) LPush(ctx context.Context, key string, values ...interface{}) *IntCmd
- func (c *Redis) LPushX(ctx context.Context, key string, values ...interface{}) *IntCmd
- func (c *Redis) LRange(ctx context.Context, key string, start, stop int64) *StrSliceCmd
- func (c *Redis) LRem(ctx context.Context, key string, count int64, value interface{}) *IntCmd
- func (c *Redis) LSet(ctx context.Context, key string, index int64, value interface{}) *StatusCmd
- func (c *Redis) LTrim(ctx context.Context, key string, start, stop int64) *StatusCmd
- func (c *Redis) MGet(ctx context.Context, keys ...string) *SliceCmd
- func (c *Redis) MSet(ctx context.Context, pairs ...interface{}) *StatusCmd
- func (c *Redis) PExpire(ctx context.Context, key string, expiration time.Duration) *BoolCmd
- func (c *Redis) PExpireAt(ctx context.Context, key string, tm time.Time) *BoolCmd
- func (c *Redis) PFAdd(ctx context.Context, key string, els ...interface{}) *IntCmd
- func (c *Redis) PFCount(ctx context.Context, keys ...string) *IntCmd
- func (c *Redis) PFMerge(ctx context.Context, dest string, keys ...string) *StatusCmd
- func (c *Redis) PTTL(ctx context.Context, key string) *DurationCmd
- func (c *Redis) Persist(ctx context.Context, key string) *BoolCmd
- func (c *Redis) RPop(ctx context.Context, key string) *StringCmd
- func (c *Redis) RPush(ctx context.Context, key string, values ...interface{}) *IntCmd
- func (c *Redis) RPushX(ctx context.Context, key string, values ...interface{}) *IntCmd
- func (c *Redis) SAdd(ctx context.Context, key string, members ...interface{}) *IntCmd
- func (c *Redis) SCard(ctx context.Context, key string) *IntCmd
- func (c *Redis) SDiff(ctx context.Context, keys ...string) *StrSliceCmd
- func (c *Redis) SDiffStore(destination string, ctx context.Context, keys ...string) *IntCmd
- func (c *Redis) SInter(ctx context.Context, keys ...string) *StrSliceCmd
- func (c *Redis) SInterStore(destination string, ctx context.Context, keys ...string) *IntCmd
- func (c *Redis) SIsMember(ctx context.Context, key string, member interface{}) *BoolCmd
- func (c *Redis) SMembers(ctx context.Context, key string) *StrSliceCmd
- func (c *Redis) SMove(ctx context.Context, source, destination string, member interface{}) *BoolCmd
- func (c *Redis) SPop(ctx context.Context, key string) *StringCmd
- func (c *Redis) SPopN(ctx context.Context, key string, count int64) *StrSliceCmd
- func (c *Redis) SRandMember(ctx context.Context, key string) *StringCmd
- func (c *Redis) SRandMemberN(ctx context.Context, key string, count int64) *StrSliceCmd
- func (c *Redis) SRem(ctx context.Context, key string, members ...interface{}) *IntCmd
- func (c *Redis) SUnion(ctx context.Context, keys ...string) *StrSliceCmd
- func (c *Redis) SUnionStore(destination string, ctx context.Context, keys ...string) *IntCmd
- func (c *Redis) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) *StatusCmd
- func (c *Redis) SetBit(ctx context.Context, key string, offset int64, value int) *IntCmd
- func (c *Redis) SetNX(ctx context.Context, key string, value interface{}, expiration time.Duration) *BoolCmd
- func (c *Redis) SetRange(ctx context.Context, key string, offset int64, value string) *IntCmd
- func (c *Redis) SetXX(ctx context.Context, key string, value interface{}) *BoolCmd
- func (c *Redis) StrLen(ctx context.Context, key string) *IntCmd
- func (c *Redis) TTL(ctx context.Context, key string) *DurationCmd
- func (c *Redis) Type(ctx context.Context, key string) *StatusCmd
- func (c *Redis) ZAdd(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c *Redis) ZAddCh(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c *Redis) ZAddNX(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c *Redis) ZAddNXCh(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c *Redis) ZAddXX(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c *Redis) ZAddXXCh(ctx context.Context, key string, members ...*Z) *IntCmd
- func (c *Redis) ZCard(ctx context.Context, key string) *IntCmd
- func (c *Redis) ZCount(ctx context.Context, key, min, max string) *IntCmd
- func (c *Redis) ZIncr(ctx context.Context, key string, member *Z) *FloatCmd
- func (c *Redis) ZIncrBy(ctx context.Context, key string, increment float64, member string) *FloatCmd
- func (c *Redis) ZIncrNX(ctx context.Context, key string, member *Z) *FloatCmd
- func (c *Redis) ZIncrXX(ctx context.Context, key string, member *Z) *FloatCmd
- func (c *Redis) ZInterStore(ctx context.Context, destination string, store *ZStore) *IntCmd
- func (c *Redis) ZRange(ctx context.Context, key string, start, stop int64) *StrSliceCmd
- func (c *Redis) ZRangeByScore(ctx context.Context, key string, opt *ZRangeBy) *StrSliceCmd
- func (c *Redis) ZRangeByScoreWithScores(ctx context.Context, key string, opt *ZRangeBy) *ZSliceCmd
- func (c *Redis) ZRangeWithScores(ctx context.Context, key string, start, stop int64) *ZSliceCmd
- func (c *Redis) ZRank(ctx context.Context, key, member string) *IntCmd
- func (c *Redis) ZRem(ctx context.Context, key string, members ...interface{}) *IntCmd
- func (c *Redis) ZRemRangeByRank(ctx context.Context, key string, start, stop int64) *IntCmd
- func (c *Redis) ZRemRangeByScore(ctx context.Context, key, min, max string) *IntCmd
- func (c *Redis) ZRevRange(ctx context.Context, key string, start, stop int64) *StrSliceCmd
- func (c *Redis) ZRevRangeByScore(ctx context.Context, key string, opt *ZRangeBy) *StrSliceCmd
- func (c *Redis) ZRevRangeByScoreWithScores(ctx context.Context, key string, opt *ZRangeBy) *ZSliceCmd
- func (c *Redis) ZRevRangeWithScores(ctx context.Context, key string, start, stop int64) *ZSliceCmd
- func (c *Redis) ZRevRank(ctx context.Context, key, member string) *IntCmd
- func (c *Redis) ZScore(ctx context.Context, key, member string) *FloatCmd
- func (c *Redis) ZUnionStore(ctx context.Context, dest string, store *ZStore) *IntCmd
- type SliceCmd
- type StatusCmd
- type StrSliceCmd
- type StrStrMapCmd
- type StringCmd
- func (c *StringCmd) Err() error
- func (c *StringCmd) Float64() (float64, error)
- func (c *StringCmd) Int() (int, error)
- func (c *StringCmd) Int64() (int64, error)
- func (c *StringCmd) Result() (string, error)
- func (c *StringCmd) Time() (time.Time, error)
- func (c *StringCmd) Uint64() (uint64, error)
- func (c *StringCmd) Val() string
- type Z
- type ZRangeBy
- type ZSlice
- type ZSliceCmd
- type ZStore
Constants ¶
const KeepTTL = -1
KeepTTL is an option for Set command to keep key's existing TTL. For example: Set(key, value, redis.KeepTTL)
const Nil = ErrorRedis("redis: nil")
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BitCountArgs ¶
type BitCountArgs struct {
Start, End int64
}
type DurationCmd ¶
type DurationCmd struct {
// contains filtered or unexported fields
}
func NewDurationCmd ¶
func NewDurationCmd(client *Redis, name string, args ...interface{}) *DurationCmd
func (*DurationCmd) Val ¶
func (c *DurationCmd) Val() time.Duration
type ErrorRedis ¶
type ErrorRedis string
func (ErrorRedis) Error ¶
func (e ErrorRedis) Error() string
type FloatCmd ¶
type FloatCmd struct {
// contains filtered or unexported fields
}
func NewFloatCmd ¶
type IRedis ¶
type IRedis interface { TTL(ctx context.Context, key string) *DurationCmd Type(ctx context.Context, key string) *StatusCmd Append(ctx context.Context, key, value string) *IntCmd GetRange(ctx context.Context, key string, start, end int64) *StringCmd GetSet(ctx context.Context, key string, value interface{}) *StringCmd Get(ctx context.Context, key string) *StringCmd Set(ctx context.Context, key string, value interface{}, expiration time.Duration) *StatusCmd Del(ctx context.Context, keys ...string) *IntCmd Exists(ctx context.Context, keys ...string) *IntCmd Expire(ctx context.Context, key string, expiration time.Duration) *BoolCmd ExpireAt(ctx context.Context, key string, tm time.Time) *BoolCmd Persist(ctx context.Context, key string) *BoolCmd PExpire(ctx context.Context, key string, expiration time.Duration) *BoolCmd PExpireAt(ctx context.Context, key string, tm time.Time) *BoolCmd PTTL(ctx context.Context, key string) *DurationCmd Incr(ctx context.Context, key string) *IntCmd Decr(ctx context.Context, key string) *IntCmd IncrBy(ctx context.Context, key string, value int64) *IntCmd DecrBy(ctx context.Context, key string, value int64) *IntCmd IncrByFloat(ctx context.Context, key string, value float64) *FloatCmd MGet(ctx context.Context, keys ...string) *SliceCmd MSet(ctx context.Context, pairs ...interface{}) *StatusCmd SetNX(ctx context.Context, key string, value interface{}, expiration time.Duration) *BoolCmd SetXX(ctx context.Context, key string, value interface{}) *BoolCmd SetRange(ctx context.Context, key string, offset int64, value string) *IntCmd StrLen(ctx context.Context, key string) *IntCmd GetBit(ctx context.Context, key string, offset int64) *IntCmd SetBit(ctx context.Context, key string, offset int64, value int) *IntCmd BitCount(ctx context.Context, key string, bitCount *BitCountArgs) *IntCmd HDel(ctx context.Context, key string, fields ...string) *IntCmd HExists(ctx context.Context, key, field string) *BoolCmd HGet(ctx context.Context, key, field string) *StringCmd HGetAll(ctx context.Context, key string) *StrStrMapCmd HIncrBy(ctx context.Context, key, field string, incr int64) *IntCmd HIncrByFloat(ctx context.Context, key, field string, incr float64) *FloatCmd HKeys(ctx context.Context, key string) *StrSliceCmd HLen(ctx context.Context, key string) *IntCmd HMSet(ctx context.Context, key string, pairs ...interface{}) *StatusCmd HMGet(ctx context.Context, key string, fields ...string) *SliceCmd HSet(ctx context.Context, key string, field string, value interface{}) *BoolCmd HSetNX(ctx context.Context, key, field string, value interface{}) *BoolCmd HVals(ctx context.Context, key string) *StrSliceCmd LIndex(ctx context.Context, key string, index int64) *StringCmd LInsert(ctx context.Context, key, op string, pivot, value interface{}) *IntCmd LLen(ctx context.Context, key string) *IntCmd LPop(ctx context.Context, key string) *StringCmd LPush(ctx context.Context, key string, values ...interface{}) *IntCmd LPushX(ctx context.Context, key string, values ...interface{}) *IntCmd LRange(ctx context.Context, key string, start, stop int64) *StrSliceCmd LRem(ctx context.Context, key string, count int64, value interface{}) *IntCmd LSet(ctx context.Context, key string, index int64, value interface{}) *StatusCmd LTrim(ctx context.Context, key string, start, stop int64) *StatusCmd RPop(ctx context.Context, key string) *StringCmd RPush(ctx context.Context, key string, values ...interface{}) *IntCmd RPushX(ctx context.Context, key string, values ...interface{}) *IntCmd SAdd(ctx context.Context, key string, members ...interface{}) *IntCmd SCard(ctx context.Context, key string) *IntCmd SDiff(ctx context.Context, keys ...string) *StrSliceCmd SDiffStore(destination string, ctx context.Context, keys ...string) *IntCmd SInter(ctx context.Context, keys ...string) *StrSliceCmd SInterStore(destination string, ctx context.Context, keys ...string) *IntCmd SIsMember(ctx context.Context, key string, member interface{}) *BoolCmd SMembers(ctx context.Context, key string) *StrSliceCmd SMove(ctx context.Context, source, destination string, member interface{}) *BoolCmd SPop(ctx context.Context, key string) *StringCmd SPopN(ctx context.Context, key string, count int64) *StrSliceCmd SRandMember(ctx context.Context, key string) *StringCmd SRandMemberN(ctx context.Context, key string, count int64) *StrSliceCmd SRem(ctx context.Context, key string, members ...interface{}) *IntCmd SUnion(ctx context.Context, keys ...string) *StrSliceCmd SUnionStore(destination string, ctx context.Context, keys ...string) *IntCmd ZAdd(ctx context.Context, key string, members ...*Z) *IntCmd ZAddNX(ctx context.Context, key string, members ...*Z) *IntCmd ZAddXX(ctx context.Context, key string, members ...*Z) *IntCmd ZAddCh(ctx context.Context, key string, members ...*Z) *IntCmd ZAddNXCh(ctx context.Context, key string, members ...*Z) *IntCmd ZAddXXCh(ctx context.Context, key string, members ...*Z) *IntCmd ZIncr(ctx context.Context, key string, member *Z) *FloatCmd ZIncrNX(ctx context.Context, key string, member *Z) *FloatCmd ZIncrXX(ctx context.Context, key string, member *Z) *FloatCmd ZCard(ctx context.Context, key string) *IntCmd ZCount(ctx context.Context, key, min, max string) *IntCmd ZIncrBy(ctx context.Context, key string, increment float64, member string) *FloatCmd ZInterStore(ctx context.Context, destination string, store *ZStore) *IntCmd ZRange(ctx context.Context, key string, start, stop int64) *StrSliceCmd ZRangeWithScores(ctx context.Context, key string, start, stop int64) *ZSliceCmd ZRangeByScore(ctx context.Context, key string, opt *ZRangeBy) *StrSliceCmd ZRangeByScoreWithScores(ctx context.Context, key string, opt *ZRangeBy) *ZSliceCmd ZRank(ctx context.Context, key, member string) *IntCmd ZRem(ctx context.Context, key string, members ...interface{}) *IntCmd ZRemRangeByRank(ctx context.Context, key string, start, stop int64) *IntCmd ZRemRangeByScore(ctx context.Context, key, min, max string) *IntCmd ZRevRange(ctx context.Context, key string, start, stop int64) *StrSliceCmd ZRevRangeWithScores(ctx context.Context, key string, start, stop int64) *ZSliceCmd ZRevRangeByScore(ctx context.Context, key string, opt *ZRangeBy) *StrSliceCmd ZRevRangeByScoreWithScores(ctx context.Context, key string, opt *ZRangeBy) *ZSliceCmd ZRevRank(ctx context.Context, key, member string) *IntCmd ZScore(ctx context.Context, key, member string) *FloatCmd ZUnionStore(ctx context.Context, dest string, store *ZStore) *IntCmd PFAdd(ctx context.Context, key string, els ...interface{}) *IntCmd PFCount(ctx context.Context, keys ...string) *IntCmd PFMerge(ctx context.Context, dest string, keys ...string) *StatusCmd }
type Redis ¶
type Redis struct{}
func (*Redis) HDel ¶
------------------------------------------------------------------------------ Hash
func (*Redis) HIncrByFloat ¶
func (*Redis) HMSet ¶
HMSet pairs can be map or indefinite parameter eg: 1: map[string]interface{}{"k1":"v1","k2":"v2"} 2: "k1", "v1", "k2", "v2"
func (*Redis) IncrByFloat ¶
func (*Redis) LIndex ¶
------------------------------------------------------------------------------ List
func (*Redis) MSet ¶
MSet pairs can be map or indefinite parameter eg: 1: map[string]interface{}{"k1":"v1","k2":"v2"} 2: "k1", "v1", "k2", "v2"
func (*Redis) SDiffStore ¶
func (*Redis) SInterStore ¶
func (*Redis) SMembers ¶
func (c *Redis) SMembers(ctx context.Context, key string) *StrSliceCmd
SMembers `SMEMBERS key` command output as a slice.
func (*Redis) SRandMember ¶
SRandMember `SRANDMEMBER key` command.
func (*Redis) SRandMemberN ¶
SRandMemberN `SRANDMEMBER ctx context.Context, key count` command.
func (*Redis) SUnionStore ¶
func (*Redis) SetNX ¶
func (c *Redis) SetNX(ctx context.Context, key string, value interface{}, expiration time.Duration) *BoolCmd
SetNX is short for "SET If Not Exists".
func (*Redis) ZAddCh ¶
ZAddCh `ZADD ctx context.Context, key CH score member [score member ...]` command.
func (*Redis) ZAddNX ¶
ZAddNX `ZADD ctx context.Context, key NX score member [score member ...]` command.
func (*Redis) ZAddNXCh ¶
ZAddNXCh `ZADD ctx context.Context, key NX CH score member [score member ...]` command.
func (*Redis) ZAddXX ¶
ZAddXX `ZADD ctx context.Context, key XX score member [score member ...]` command.
func (*Redis) ZAddXXCh ¶
ZAddXXCh `ZADD ctx context.Context, key XX CH score member [score member ...]` command.
func (*Redis) ZInterStore ¶
func (*Redis) ZRangeByScore ¶
func (*Redis) ZRangeByScoreWithScores ¶
func (*Redis) ZRangeWithScores ¶
func (*Redis) ZRemRangeByRank ¶
func (*Redis) ZRemRangeByScore ¶
func (*Redis) ZRevRangeByScore ¶
func (*Redis) ZRevRangeByScoreWithScores ¶
func (*Redis) ZRevRangeWithScores ¶
type SliceCmd ¶
type SliceCmd struct {
// contains filtered or unexported fields
}
func NewSliceCmd ¶
type StatusCmd ¶
type StatusCmd struct {
// contains filtered or unexported fields
}
func NewStatusCmd ¶
type StrSliceCmd ¶
type StrSliceCmd struct {
// contains filtered or unexported fields
}
func NewStrSliceCmd ¶
func NewStrSliceCmd(client *Redis, name string, args ...interface{}) *StrSliceCmd
func (*StrSliceCmd) Result ¶
func (c *StrSliceCmd) Result() ([]string, error)
func (*StrSliceCmd) Val ¶
func (c *StrSliceCmd) Val() []string
type StrStrMapCmd ¶
type StrStrMapCmd struct {
// contains filtered or unexported fields
}
func NewStrStrMapCmd ¶
func NewStrStrMapCmd(client *Redis, name string, args ...interface{}) *StrStrMapCmd
func (*StrStrMapCmd) Val ¶
func (c *StrStrMapCmd) Val() map[string]string
type StringCmd ¶
type StringCmd struct {
// contains filtered or unexported fields
}
func NewStringCmd ¶
type ZSliceCmd ¶
type ZSliceCmd struct {
// contains filtered or unexported fields
}