Documentation
¶
Index ¶
- Constants
- func Close() error
- func Init(c *Config) error
- func Process(ctx context.Context, cmd Cmder) error
- type BoolCmd
- func Expire(ctx context.Context, key string, expiration time.Duration) *BoolCmd
- func ExpireAt(ctx context.Context, key string, tm time.Time) *BoolCmd
- func HExists(ctx context.Context, key, field string) *BoolCmd
- func HMSet(ctx context.Context, key string, values ...interface{}) *BoolCmd
- func HSetNX(ctx context.Context, key, field string, value interface{}) *BoolCmd
- func MSetNX(ctx context.Context, values ...interface{}) *BoolCmd
- func SIsMember(ctx context.Context, key string, member interface{}) *BoolCmd
- func SMove(ctx context.Context, source, destination string, member interface{}) *BoolCmd
- func SetNX(ctx context.Context, key string, value interface{}, expiration time.Duration) *BoolCmd
- func SetXX(ctx context.Context, key string, value interface{}, expiration time.Duration) *BoolCmd
- type BoolSliceCmd
- type CacheRides
- type Cmd
- type Cmder
- type Config
- type FloatCmd
- func GeoDist(ctx context.Context, key string, member1, member2, unit string) *FloatCmd
- func HIncrByFloat(ctx context.Context, key, field string, incr float64) *FloatCmd
- func ZIncr(ctx context.Context, key string, member *Z) *FloatCmd
- func ZIncrBy(ctx context.Context, key string, increment float64, member string) *FloatCmd
- func ZIncrNX(ctx context.Context, key string, member *Z) *FloatCmd
- func ZIncrXX(ctx context.Context, key string, member *Z) *FloatCmd
- func ZScore(ctx context.Context, key, member string) *FloatCmd
- type GeoLocation
- type GeoLocationCmd
- type GeoPosCmd
- type GeoRadiusQuery
- type IntCmd
- func Append(ctx context.Context, key, value string) *IntCmd
- func BitCount(ctx context.Context, key string, start, end int64) *IntCmd
- func BitOpAnd(ctx context.Context, destKey string, keys ...string) *IntCmd
- func BitOpNot(ctx context.Context, destKey string, key string) *IntCmd
- func BitOpOr(ctx context.Context, destKey string, keys ...string) *IntCmd
- func BitOpXor(ctx context.Context, destKey string, keys ...string) *IntCmd
- func BitPos(ctx context.Context, key string, bit int64, pos ...int64) *IntCmd
- func Del(ctx context.Context, keys ...string) *IntCmd
- func Exists(ctx context.Context, keys ...string) *IntCmd
- func GeoAdd(ctx context.Context, key string, geoLocation ...*GeoLocation) *IntCmd
- func GeoRadiusByMemberStore(ctx context.Context, key, member string, query *GeoRadiusQuery) *IntCmd
- func GeoRadiusStore(ctx context.Context, key string, longitude, latitude float64, ...) *IntCmd
- func GetBit(ctx context.Context, key string, offset int64) *IntCmd
- func HDel(ctx context.Context, key string, fields ...string) *IntCmd
- func HIncrBy(ctx context.Context, key, field string, incr int64) *IntCmd
- func HLen(ctx context.Context, key string) *IntCmd
- func HSet(ctx context.Context, key string, values ...interface{}) *IntCmd
- func Incr(ctx context.Context, key string) *IntCmd
- func IncrBy(ctx context.Context, key string, value int64) *IntCmd
- func LInsert(ctx context.Context, key, op string, pivot, value interface{}) *IntCmd
- func LInsertAfter(ctx context.Context, key string, pivot, value interface{}) *IntCmd
- func LInsertBefore(ctx context.Context, key string, pivot, value interface{}) *IntCmd
- func LLen(ctx context.Context, key string) *IntCmd
- func LPush(ctx context.Context, key string, values ...interface{}) *IntCmd
- func LPushX(ctx context.Context, key string, values ...interface{}) *IntCmd
- func LRem(ctx context.Context, key string, count int64, value interface{}) *IntCmd
- func PubSubNumPat(ctx context.Context) *IntCmd
- func Publish(ctx context.Context, channel string, message interface{}) *IntCmd
- func RPush(ctx context.Context, key string, values ...interface{}) *IntCmd
- func RPushX(ctx context.Context, key string, values ...interface{}) *IntCmd
- func SAdd(ctx context.Context, key string, members ...interface{}) *IntCmd
- func SCard(ctx context.Context, key string) *IntCmd
- func SDiffStore(ctx context.Context, destination string, keys ...string) *IntCmd
- func SInterStore(ctx context.Context, destination string, keys ...string) *IntCmd
- func SRem(ctx context.Context, key string, members ...interface{}) *IntCmd
- func SUnionStore(ctx context.Context, destination string, keys ...string) *IntCmd
- func SetBit(ctx context.Context, key string, offset int64, value int) *IntCmd
- func SetRange(ctx context.Context, key string, offset int64, value string) *IntCmd
- func StrLen(ctx context.Context, key string) *IntCmd
- func ZAdd(ctx context.Context, key string, members ...*Z) *IntCmd
- func ZAddCh(ctx context.Context, key string, members ...*Z) *IntCmd
- func ZAddNX(ctx context.Context, key string, members ...*Z) *IntCmd
- func ZAddNXCh(ctx context.Context, key string, members ...*Z) *IntCmd
- func ZAddXX(ctx context.Context, key string, members ...*Z) *IntCmd
- func ZAddXXCh(ctx context.Context, key string, members ...*Z) *IntCmd
- func ZCard(ctx context.Context, key string) *IntCmd
- func ZCount(ctx context.Context, key, min, max string) *IntCmd
- func ZInterStore(ctx context.Context, destination string, store *ZStore) *IntCmd
- func ZLexCount(ctx context.Context, key, min, max string) *IntCmd
- func ZRank(ctx context.Context, key, member string) *IntCmd
- func ZRem(ctx context.Context, key string, members ...interface{}) *IntCmd
- func ZRemRangeByLex(ctx context.Context, key, min, max string) *IntCmd
- func ZRemRangeByRank(ctx context.Context, key string, start, stop int64) *IntCmd
- func ZRemRangeByScore(ctx context.Context, key, min, max string) *IntCmd
- func ZRevRank(ctx context.Context, key, member string) *IntCmd
- func ZUnionStore(ctx context.Context, dest string, store *ZStore) *IntCmd
- type IntSliceCmd
- type Options
- type Pipeliner
- type PoolState
- type PubSub
- type ScanCmd
- func HScan(ctx context.Context, key string, cursor uint64, match string, count int64) *ScanCmd
- func SScan(ctx context.Context, key string, cursor uint64, match string, count int64) *ScanCmd
- func Scan(ctx context.Context, cursor uint64, match string, count int64) *ScanCmd
- func ZScan(ctx context.Context, key string, cursor uint64, match string, count int64) *ScanCmd
- type SliceCmd
- type SlowLogCmd
- type StatusCmd
- func LSet(ctx context.Context, key string, index int64, value interface{}) *StatusCmd
- func LTrim(ctx context.Context, key string, start, stop int64) *StatusCmd
- func MSet(ctx context.Context, values ...interface{}) *StatusCmd
- func ScriptFlush(ctx context.Context) *StatusCmd
- func ScriptKill(ctx context.Context) *StatusCmd
- func Set(ctx context.Context, key string, value interface{}, expiration time.Duration) *StatusCmd
- type StringCmd
- func BRPopLPush(ctx context.Context, source, destination string, timeout time.Duration) *StringCmd
- func Get(ctx context.Context, key string) *StringCmd
- func HGet(ctx context.Context, key, field string) *StringCmd
- func LIndex(ctx context.Context, key string, index int64) *StringCmd
- func LPop(ctx context.Context, key string) *StringCmd
- func RPop(ctx context.Context, key string) *StringCmd
- func RPopLPush(ctx context.Context, source, destination string) *StringCmd
- func SPop(ctx context.Context, key string) *StringCmd
- func SRandMember(ctx context.Context, key string) *StringCmd
- func ScriptLoad(ctx context.Context, script string) *StringCmd
- type StringIntMapCmd
- type StringSliceCmd
- func BLPop(ctx context.Context, timeout time.Duration, keys ...string) *StringSliceCmd
- func BRPop(ctx context.Context, timeout time.Duration, keys ...string) *StringSliceCmd
- func GeoHash(ctx context.Context, key string, members ...string) *StringSliceCmd
- func HKeys(ctx context.Context, key string) *StringSliceCmd
- func HVals(ctx context.Context, key string) *StringSliceCmd
- func LRange(ctx context.Context, key string, start, stop int64) *StringSliceCmd
- func PubSubChannels(ctx context.Context, pattern string) *StringSliceCmd
- func SDiff(ctx context.Context, keys ...string) *StringSliceCmd
- func SInter(ctx context.Context, keys ...string) *StringSliceCmd
- func SMembers(ctx context.Context, key string) *StringSliceCmd
- func SPopN(ctx context.Context, key string, count int64) *StringSliceCmd
- func SRandMemberN(ctx context.Context, key string, count int64) *StringSliceCmd
- func SUnion(ctx context.Context, keys ...string) *StringSliceCmd
- func ZRange(ctx context.Context, key string, start, stop int64) *StringSliceCmd
- func ZRangeByLex(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd
- func ZRangeByScore(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd
- func ZRevRange(ctx context.Context, key string, start, stop int64) *StringSliceCmd
- func ZRevRangeByLex(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd
- func ZRevRangeByScore(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd
- type StringStringMapCmd
- type StringStructMapCmd
- type XInfoGroupsCmd
- type XInfoStreamCmd
- type XMessageSliceCmd
- type XPendingCmd
- type XPendingExtCmd
- type XStreamSliceCmd
- type Z
- type ZRangeBy
- type ZSliceCmd
- func ZPopMax(ctx context.Context, key string, count ...int64) *ZSliceCmd
- func ZPopMin(ctx context.Context, key string, count ...int64) *ZSliceCmd
- func ZRangeByScoreWithScores(ctx context.Context, key string, opt *ZRangeBy) *ZSliceCmd
- func ZRangeWithScores(ctx context.Context, key string, start, stop int64) *ZSliceCmd
- func ZRevRangeByScoreWithScores(ctx context.Context, key string, opt *ZRangeBy) *ZSliceCmd
- func ZRevRangeWithScores(ctx context.Context, key string, start, stop int64) *ZSliceCmd
- type ZStore
- type ZWithKey
- type ZWithKeyCmd
Constants ¶
const Nil = RS.Nil
Nil reply returned by Redis when key does not exist.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BoolCmd ¶
BoolCmd BoolCmd
func MSetNX ¶
MSetNX is like SetNX but accepts multiple values:
- MSetNX("key1", "value1", "key2", "value2")
- MSetNX([]string{"key1", "value1", "key2", "value2"})
- MSetNX(map[string]interface{}{"key1": "value1", "key2": "value2"})
type BoolSliceCmd ¶
type BoolSliceCmd = RS.BoolSliceCmd
BoolSliceCmd BoolSliceCmd
func ScriptExists ¶
func ScriptExists(ctx context.Context, hashes ...string) *BoolSliceCmd
ScriptExists ScriptExists
type CacheRides ¶
type CacheRides struct {
// contains filtered or unexported fields
}
CacheRides CacheRides
type Cmd ¶
Cmd Cmd
type FloatCmd ¶
FloatCmd FloatCmd
func HIncrByFloat ¶
HIncrByFloat HIncrByFloat
type GeoLocationCmd ¶
type GeoLocationCmd = RS.GeoLocationCmd
GeoLocationCmd GeoLocationCmd
func GeoRadius ¶
func GeoRadius(ctx context.Context, key string, longitude, latitude float64, query *GeoRadiusQuery) *GeoLocationCmd
GeoRadius is a read-only GEORADIUS_RO command.
func GeoRadiusByMember ¶
func GeoRadiusByMember(ctx context.Context, key, member string, query *GeoRadiusQuery) *GeoLocationCmd
GeoRadiusByMember GeoRadius is a read-only GEORADIUSBYMEMBER_RO command.
type IntCmd ¶
IntCmd IntCmd
func GeoAdd ¶
func GeoAdd(ctx context.Context, key string, geoLocation ...*GeoLocation) *IntCmd
GeoAdd
func GeoRadiusByMemberStore ¶
func GeoRadiusByMemberStore(ctx context.Context, key, member string, query *GeoRadiusQuery) *IntCmd
GeoRadiusByMemberStore is a writing GEORADIUSBYMEMBER command.
func GeoRadiusStore ¶
func GeoRadiusStore(ctx context.Context, key string, longitude, latitude float64, query *GeoRadiusQuery) *IntCmd
GeoRadiusStore is a writing GEORADIUS command.
func HSet ¶
HSet accepts values in following formats:
- HSet("myhash", "key1", "value1", "key2", "value2")
- HSet("myhash", []string{"key1", "value1", "key2", "value2"})
- HSet("myhash", map[string]interface{}{"key1": "value1", "key2": "value2"})
Note that it requires Redis v4 for multiple field/value pairs support.
func LInsertAfter ¶
LInsertAfter LInsertAfter
func LInsertBefore ¶
LInsertBefore LInsertBefore
func SDiffStore ¶
SDiffStore SDiffStore
func SInterStore ¶
SInterStore SInterStore
func SUnionStore ¶
SUnionStore SUnionStore
func ZInterStore ¶
ZInterStore ZInterStore
func ZRemRangeByLex ¶
ZRemRangeByLex ZRemRangeByLex
func ZRemRangeByRank ¶
ZRemRangeByRank ZRemRangeByRank
func ZRemRangeByScore ¶
ZRemRangeByScore ZRemRangeByScore
type Options ¶
Options Options
func GetOptions ¶
func GetOptions() *Options
Options returns read-only Options that were used to create the client.
type Pipeliner ¶
Pipeliner Pipeliner
func TxPipeline ¶
func TxPipeline() Pipeliner
TxPipeline acts like Pipeline, but wraps queued commands with MULTI/EXEC.
type PubSub ¶
PubSub PubSub
func PSubscribe ¶
PSubscribe subscribes the client to the given patterns. Patterns can be omitted to create empty subscription.
func Subscribe ¶
Subscribe subscribes the client to the specified channels. Channels can be omitted to create empty subscription. Note that this method does not wait on a response from Redis, so the subscription may not be active immediately. To force the connection to wait, you may call the Receive() method on the returned *PubSub like so:
sub := client.Subscribe(queryResp)
iface, err := sub.Receive()
if err != nil {
// handle error
}
// Should be *Subscription, but others are possible if other actions have been
// taken on sub since it was created.
switch iface.(type) {
case *Subscription:
// subscribe succeeded
case *Message:
// received first message
case *Pong:
// pong received
default:
// handle error
}
ch := sub.Channel()
type ScanCmd ¶
ScanCmd ScanCmd
type StatusCmd ¶
StatusCmd StatusCmd
func MSet ¶
MSet is like Set but accepts multiple values:
- MSet("key1", "value1", "key2", "value2")
- MSet([]string{"key1", "value1", "key2", "value2"})
- MSet(map[string]interface{}{"key1": "value1", "key2": "value2"})
type StringCmd ¶
StringCmd StringCmd
func BRPopLPush ¶
BRPopLPush BRPopLPush
func SRandMember ¶
SRandMember Redis `SRANDMEMBER key` command.
type StringIntMapCmd ¶
type StringIntMapCmd = RS.StringIntMapCmd
StringIntMapCmd StringIntMapCmd
func PubSubNumSub ¶
func PubSubNumSub(ctx context.Context, channels ...string) *StringIntMapCmd
PubSubNumSub PubSubNumSub
type StringSliceCmd ¶
type StringSliceCmd = RS.StringSliceCmd
StringSliceCmd StringSliceCmd
func GeoHash ¶
func GeoHash(ctx context.Context, key string, members ...string) *StringSliceCmd
GeoHash GeoHash
func LRange ¶
func LRange(ctx context.Context, key string, start, stop int64) *StringSliceCmd
LRange LRange
func PubSubChannels ¶
func PubSubChannels(ctx context.Context, pattern string) *StringSliceCmd
PubSubChannels PubSubChannels
func SMembers ¶
func SMembers(ctx context.Context, key string) *StringSliceCmd
SMembers Redis `SMEMBERS key` command output as a slice.
func SPopN ¶
func SPopN(ctx context.Context, key string, count int64) *StringSliceCmd
SPopN Redis `SPOP key count` command.
func SRandMemberN ¶
func SRandMemberN(ctx context.Context, key string, count int64) *StringSliceCmd
SRandMemberN Redis `SRANDMEMBER key count` command.
func ZRange ¶
func ZRange(ctx context.Context, key string, start, stop int64) *StringSliceCmd
ZRange ZRange
func ZRangeByLex ¶
func ZRangeByLex(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd
ZRangeByLex ZRangeByLex
func ZRangeByScore ¶
func ZRangeByScore(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd
ZRangeByScore ZRangeByScore
func ZRevRange ¶
func ZRevRange(ctx context.Context, key string, start, stop int64) *StringSliceCmd
ZRevRange ZRevRange
func ZRevRangeByLex ¶
func ZRevRangeByLex(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd
ZRevRangeByLex ZRevRangeByLex
func ZRevRangeByScore ¶
func ZRevRangeByScore(ctx context.Context, key string, opt *ZRangeBy) *StringSliceCmd
ZRevRangeByScore ZRevRangeByScore
type StringStringMapCmd ¶
type StringStringMapCmd = RS.StringStringMapCmd
StringStringMapCmd StringStringMapCmd
type StringStructMapCmd ¶
type StringStructMapCmd = RS.StringStructMapCmd
StringStructMapCmd StringStructMapCmd
func SMembersMap ¶
func SMembersMap(ctx context.Context, key string) *StringStructMapCmd
SMembersMap Redis `SMEMBERS key` command output as a map.
type XMessageSliceCmd ¶
type XMessageSliceCmd = RS.XMessageSliceCmd
XMessageSliceCmd XMessageSliceCmd
type ZSliceCmd ¶
ZSliceCmd ZSliceCmd
func ZRangeByScoreWithScores ¶
ZRangeByScoreWithScores ZRangeByScoreWithScores
func ZRangeWithScores ¶
ZRangeWithScores ZRangeWithScores
func ZRevRangeByScoreWithScores ¶
ZRevRangeByScoreWithScores ZRevRangeByScoreWithScores
type ZWithKey ¶
ZWithKey represents sorted set member including the name of the key where it was popped.
type ZWithKeyCmd ¶
type ZWithKeyCmd = RS.ZWithKeyCmd
ZWithKeyCmd ZWithKeyCmd