redis

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Nil = redis.Nil
)

Variables

This section is empty.

Functions

func Append

func Append(ctx context.Context, key, value string) (int64, error)

func BLPop

func BLPop(ctx context.Context, timeout time.Duration, keys ...string) ([]string, error)

func BRPop

func BRPop(ctx context.Context, timeout time.Duration, keys ...string) ([]string, error)

func BRPopLPush

func BRPopLPush(ctx context.Context, source, destination string, timeout time.Duration) (string, error)

func BZPopMax

func BZPopMax(ctx context.Context, timeout time.Duration, keys ...string) (*redis.ZWithKey, error)

func BZPopMin

func BZPopMin(ctx context.Context, timeout time.Duration, keys ...string) (*redis.ZWithKey, error)

func BgRewriteAOF

func BgRewriteAOF(ctx context.Context) (string, error)

func BgSave

func BgSave(ctx context.Context) (string, error)

func BitCount

func BitCount(ctx context.Context, key string, bitCount *redis.BitCount) (int64, error)

func BitField

func BitField(ctx context.Context, key string, args ...interface{}) ([]int64, error)

func BitOpAnd

func BitOpAnd(ctx context.Context, destKey string, keys ...string) (int64, error)

func BitOpNot

func BitOpNot(ctx context.Context, destKey string, key string) (int64, error)

func BitOpOr

func BitOpOr(ctx context.Context, destKey string, keys ...string) (int64, error)

func BitOpXor

func BitOpXor(ctx context.Context, destKey string, keys ...string) (int64, error)

func BitPos

func BitPos(ctx context.Context, key string, bit int64, pos ...int64) (int64, error)

func Client

func Client() redis.Cmdable

func ClientGetName

func ClientGetName(ctx context.Context) (string, error)

func ClientID

func ClientID(ctx context.Context) (int64, error)

func ClientKill

func ClientKill(ctx context.Context, ipPort string) (string, error)

func ClientKillByFilter

func ClientKillByFilter(ctx context.Context, keys ...string) (int64, error)

func ClientList

func ClientList(ctx context.Context) (string, error)

func ClientPause

func ClientPause(ctx context.Context, dur time.Duration) (bool, error)

func Close

func Close() error

func ClusterAddSlots

func ClusterAddSlots(ctx context.Context, slots ...int) (string, error)

func ClusterAddSlotsRange

func ClusterAddSlotsRange(ctx context.Context, min, max int) (string, error)

func ClusterCountFailureReports

func ClusterCountFailureReports(ctx context.Context, nodeID string) (int64, error)

func ClusterCountKeysInSlot

func ClusterCountKeysInSlot(ctx context.Context, slot int) (int64, error)

func ClusterDelSlots

func ClusterDelSlots(ctx context.Context, slots ...int) (string, error)

func ClusterDelSlotsRange

func ClusterDelSlotsRange(ctx context.Context, min, max int) (string, error)

func ClusterFailover

func ClusterFailover(ctx context.Context) (string, error)

func ClusterForget

func ClusterForget(ctx context.Context, nodeID string) (string, error)

func ClusterGetKeysInSlot

func ClusterGetKeysInSlot(ctx context.Context, slot int, count int) ([]string, error)

func ClusterInfo

func ClusterInfo(ctx context.Context) (string, error)

func ClusterKeySlot

func ClusterKeySlot(ctx context.Context, key string) (int64, error)

func ClusterMeet

func ClusterMeet(ctx context.Context, host, port string) (string, error)

func ClusterNodes

func ClusterNodes(ctx context.Context) (string, error)

func ClusterReplicate

func ClusterReplicate(ctx context.Context, nodeID string) (string, error)

func ClusterResetHard

func ClusterResetHard(ctx context.Context) (string, error)

func ClusterResetSoft

func ClusterResetSoft(ctx context.Context) (string, error)

func ClusterSaveConfig

func ClusterSaveConfig(ctx context.Context) (string, error)

func ClusterSlaves

func ClusterSlaves(ctx context.Context, nodeID string) ([]string, error)

func ClusterSlots

func ClusterSlots(ctx context.Context) ([]redis.ClusterSlot, error)

func Command

func Command(ctx context.Context) (map[string]*redis.CommandInfo, error)

func ConfigGet

func ConfigGet(ctx context.Context, parameter string) ([]interface{}, error)

func ConfigResetStat

func ConfigResetStat(ctx context.Context) (string, error)

func ConfigRewrite

func ConfigRewrite(ctx context.Context) (string, error)

func ConfigSet

func ConfigSet(ctx context.Context, parameter, value string) (string, error)

func DBSize

func DBSize(ctx context.Context) (int64, error)

func DebugObject

func DebugObject(ctx context.Context, key string) (string, error)

func Decr

func Decr(ctx context.Context, key string) (int64, error)

func DecrBy

func DecrBy(ctx context.Context, key string, decrement int64) (int64, error)

func Del

func Del(ctx context.Context, keys ...string) (int64, error)

func Dump

func Dump(ctx context.Context, key string) (string, error)

func Echo

func Echo(ctx context.Context, message interface{}) (string, error)

func Eval

func Eval(ctx context.Context, script string, keys []string, args ...interface{}) (interface{}, error)

func EvalSha

func EvalSha(ctx context.Context, sha1 string, keys []string, args ...interface{}) (interface{}, error)

func Exists

func Exists(ctx context.Context, keys ...string) (int64, error)

func Expire

func Expire(ctx context.Context, key string, expiration time.Duration) (bool, error)

func ExpireAt

func ExpireAt(ctx context.Context, key string, tm time.Time) (bool, error)

func FlushAll

func FlushAll(ctx context.Context) (string, error)

func FlushAllAsync

func FlushAllAsync(ctx context.Context) (string, error)

func FlushDB

func FlushDB(ctx context.Context) (string, error)

func FlushDBAsync

func FlushDBAsync(ctx context.Context) (string, error)

func GeoAdd

func GeoAdd(ctx context.Context, key string, geoLocation ...*redis.GeoLocation) (int64, error)

func GeoDist

func GeoDist(ctx context.Context, key string, member1, member2, unit string) (float64, error)

func GeoHash

func GeoHash(ctx context.Context, key string, members ...string) ([]string, error)

func GeoPos

func GeoPos(ctx context.Context, key string, members ...string) ([]*redis.GeoPos, error)

func GeoRadius

func GeoRadius(ctx context.Context, key string, longitude, latitude float64, query *redis.GeoRadiusQuery) ([]redis.GeoLocation, error)

func GeoRadiusByMember

func GeoRadiusByMember(ctx context.Context, key, member string, query *redis.GeoRadiusQuery) ([]redis.GeoLocation, error)

func GeoRadiusByMemberStore

func GeoRadiusByMemberStore(ctx context.Context, key, member string, query *redis.GeoRadiusQuery) (int64, error)

func GeoRadiusStore

func GeoRadiusStore(ctx context.Context, key string, longitude, latitude float64, query *redis.GeoRadiusQuery) (int64, error)

func Get

func Get(ctx context.Context, key string) (string, error)

func GetBit

func GetBit(ctx context.Context, key string, offset int64) (int64, error)

func GetRange

func GetRange(ctx context.Context, key string, start, end int64) (string, error)

func GetSet

func GetSet(ctx context.Context, key string, value interface{}) (string, error)

func HDel

func HDel(ctx context.Context, key string, fields ...string) (int64, error)

func HExists

func HExists(ctx context.Context, key, field string) (bool, error)

func HGet

func HGet(ctx context.Context, key, field string) (string, error)

func HGetAll

func HGetAll(ctx context.Context, key string) (map[string]string, error)

func HIncrBy

func HIncrBy(ctx context.Context, key, field string, incr int64) (int64, error)

func HIncrByFloat

func HIncrByFloat(ctx context.Context, key, field string, incr float64) (float64, error)

func HKeys

func HKeys(ctx context.Context, key string) ([]string, error)

func HLen

func HLen(ctx context.Context, key string) (int64, error)

func HMGet

func HMGet(ctx context.Context, key string, fields ...string) ([]interface{}, error)

func HMSet

func HMSet(ctx context.Context, key string, values ...interface{}) (bool, error)

func HScan

func HScan(ctx context.Context, key string, cursor uint64, match string, count int64) ([]string, uint64, error)

func HSet

func HSet(ctx context.Context, key string, values ...interface{}) (int64, error)

func HSetNX

func HSetNX(ctx context.Context, key, field string, value interface{}) (bool, error)

func HVals

func HVals(ctx context.Context, key string) ([]string, error)

func Incr

func Incr(ctx context.Context, key string) (int64, error)

func IncrBy

func IncrBy(ctx context.Context, key string, value int64) (int64, error)

func IncrByFloat

func IncrByFloat(ctx context.Context, key string, value float64) (float64, error)

func Info

func Info(ctx context.Context, section ...string) (string, error)

func Init

func Init() error

func IsNil

func IsNil(err error) bool

func IsNotNil

func IsNotNil(err error) bool

func KeyPrefix

func KeyPrefix() string

func Keys

func Keys(ctx context.Context, pattern string) ([]string, error)

func LIndex

func LIndex(ctx context.Context, key string, index int64) (string, error)

func LInsert

func LInsert(ctx context.Context, key, op string, pivot, value interface{}) (int64, error)

func LInsertAfter

func LInsertAfter(ctx context.Context, key string, pivot, value interface{}) (int64, error)

func LInsertBefore

func LInsertBefore(ctx context.Context, key string, pivot, value interface{}) (int64, error)

func LLen

func LLen(ctx context.Context, key string) (int64, error)

func LPop

func LPop(ctx context.Context, key string) (string, error)

func LPos

func LPos(ctx context.Context, key string, value string, args redis.LPosArgs) (int64, error)

func LPosCount

func LPosCount(ctx context.Context, key string, value string, count int64, args redis.LPosArgs) ([]int64, error)

func LPush

func LPush(ctx context.Context, key string, values ...interface{}) (int64, error)

func LPushX

func LPushX(ctx context.Context, key string, values ...interface{}) (int64, error)

func LRange

func LRange(ctx context.Context, key string, start, stop int64) ([]string, error)

func LRem

func LRem(ctx context.Context, key string, count int64, value interface{}) (int64, error)

func LSet

func LSet(ctx context.Context, key string, index int64, value interface{}) (string, error)

func LTrim

func LTrim(ctx context.Context, key string, start, stop int64) (string, error)

func LastSave

func LastSave(ctx context.Context) (int64, error)

func MGet

func MGet(ctx context.Context, keys ...string) ([]interface{}, error)

func MSet

func MSet(ctx context.Context, values ...interface{}) (string, error)

func MSetNX

func MSetNX(ctx context.Context, values ...interface{}) (bool, error)

func MemoryUsage

func MemoryUsage(ctx context.Context, key string, samples ...int) (int64, error)

func Migrate

func Migrate(ctx context.Context, host, port, key string, db int, timeout time.Duration) (string, error)

func Move

func Move(ctx context.Context, key string, db int) (bool, error)

func ObjectEncoding

func ObjectEncoding(ctx context.Context, key string) (string, error)

func ObjectIdleTime

func ObjectIdleTime(ctx context.Context, key string) (time.Duration, error)

func ObjectRefCount

func ObjectRefCount(ctx context.Context, key string) (int64, error)

func PExpire

func PExpire(ctx context.Context, key string, expiration time.Duration) (bool, error)

func PExpireAt

func PExpireAt(ctx context.Context, key string, tm time.Time) (bool, error)

func PFAdd

func PFAdd(ctx context.Context, key string, els ...interface{}) (int64, error)

func PFCount

func PFCount(ctx context.Context, keys ...string) (int64, error)

func PFMerge

func PFMerge(ctx context.Context, dest string, keys ...string) (string, error)

func PTTL

func PTTL(ctx context.Context, key string) (time.Duration, error)

func Persist

func Persist(ctx context.Context, key string) (bool, error)

func Ping

func Ping(ctx context.Context) (string, error)

func PubSubChannels

func PubSubChannels(ctx context.Context, pattern string) ([]string, error)

func PubSubNumPat

func PubSubNumPat(ctx context.Context) (int64, error)

func PubSubNumSub

func PubSubNumSub(ctx context.Context, channels ...string) (map[string]int64, error)

func Publish

func Publish(ctx context.Context, channel string, message interface{}) (int64, error)

func RPop

func RPop(ctx context.Context, key string) (string, error)

func RPopLPush

func RPopLPush(ctx context.Context, source, destination string) (string, error)

func RPush

func RPush(ctx context.Context, key string, values ...interface{}) (int64, error)

func RPushX

func RPushX(ctx context.Context, key string, values ...interface{}) (int64, error)

func RandomKey

func RandomKey(ctx context.Context) (string, error)

func ReadOnly

func ReadOnly(ctx context.Context) (string, error)

func ReadWrite

func ReadWrite(ctx context.Context) (string, error)

func Rename

func Rename(ctx context.Context, key, newkey string) (string, error)

func RenameNX

func RenameNX(ctx context.Context, key, newkey string) (bool, error)

func Restore

func Restore(ctx context.Context, key string, ttl time.Duration, value string) (string, error)

func RestoreReplace

func RestoreReplace(ctx context.Context, key string, ttl time.Duration, value string) (string, error)

func SAdd

func SAdd(ctx context.Context, key string, members ...interface{}) (int64, error)

func SCard

func SCard(ctx context.Context, key string) (int64, error)

func SDiff

func SDiff(ctx context.Context, keys ...string) ([]string, error)

func SDiffStore

func SDiffStore(ctx context.Context, destination string, keys ...string) (int64, error)

func SInter

func SInter(ctx context.Context, keys ...string) ([]string, error)

func SInterStore

func SInterStore(ctx context.Context, destination string, keys ...string) (int64, error)

func SIsMember

func SIsMember(ctx context.Context, key string, member interface{}) (bool, error)

func SMembers

func SMembers(ctx context.Context, key string) ([]string, error)

func SMembersMap

func SMembersMap(ctx context.Context, key string) (map[string]struct{}, error)

func SMove

func SMove(ctx context.Context, source, destination string, member interface{}) (bool, error)

func SPop

func SPop(ctx context.Context, key string) (string, error)

func SPopN

func SPopN(ctx context.Context, key string, count int64) ([]string, error)

func SRandMember

func SRandMember(ctx context.Context, key string) (string, error)

func SRandMemberN

func SRandMemberN(ctx context.Context, key string, count int64) ([]string, error)

func SRem

func SRem(ctx context.Context, key string, members ...interface{}) (int64, error)

func SScan

func SScan(ctx context.Context, key string, cursor uint64, match string, count int64) ([]string, uint64, error)

func SUnion

func SUnion(ctx context.Context, keys ...string) ([]string, error)

func SUnionStore

func SUnionStore(ctx context.Context, destination string, keys ...string) (int64, error)

func Save

func Save(ctx context.Context) (string, error)

func Scan

func Scan(ctx context.Context, cursor uint64, match string, count int64) ([]string, uint64, error)

func ScanType

func ScanType(ctx context.Context, cursor uint64, match string, count int64, keyType string) ([]string, uint64, error)

func ScriptExists

func ScriptExists(ctx context.Context, hashes ...string) ([]bool, error)

func ScriptFlush

func ScriptFlush(ctx context.Context) (string, error)

func ScriptKill

func ScriptKill(ctx context.Context) (string, error)

func ScriptLoad

func ScriptLoad(ctx context.Context, script string) (string, error)

func Set

func Set(ctx context.Context, key string, value interface{}, expiration time.Duration) (string, error)

func SetArgs

func SetArgs(ctx context.Context, key string, value interface{}, a redis.SetArgs) (string, error)

func SetBit

func SetBit(ctx context.Context, key string, offset int64, value int) (int64, error)

func SetEX

func SetEX(ctx context.Context, key string, value interface{}, expiration time.Duration) (string, error)

func SetNX

func SetNX(ctx context.Context, key string, value interface{}, expiration time.Duration) (bool, error)

func SetRange

func SetRange(ctx context.Context, key string, offset int64, value string) (int64, error)

func SetXX

func SetXX(ctx context.Context, key string, value interface{}, expiration time.Duration) (bool, error)

func Shutdown

func Shutdown(ctx context.Context) (string, error)

func ShutdownNoSave

func ShutdownNoSave(ctx context.Context) (string, error)

func ShutdownSave

func ShutdownSave(ctx context.Context) (string, error)

func SlaveOf

func SlaveOf(ctx context.Context, host, port string) (string, error)

func Sort

func Sort(ctx context.Context, key string, sort *redis.Sort) ([]string, error)

func SortInterfaces

func SortInterfaces(ctx context.Context, key string, sort *redis.Sort) ([]interface{}, error)

func SortStore

func SortStore(ctx context.Context, key, store string, sort *redis.Sort) (int64, error)

func StrLen

func StrLen(ctx context.Context, key string) (int64, error)

func TTL

func TTL(ctx context.Context, key string) (time.Duration, error)

func Time

func Time(ctx context.Context) (time.Time, error)

func Touch

func Touch(ctx context.Context, keys ...string) (int64, error)

func Type

func Type(ctx context.Context, key string) (string, error)
func Unlink(ctx context.Context, keys ...string) (int64, error)

func WithPrefix

func WithPrefix(k string) string

func WithPrefixes

func WithPrefixes(keys []string) []string

func XAck

func XAck(ctx context.Context, stream, group string, ids ...string) (int64, error)

func XAdd

func XAdd(ctx context.Context, a *redis.XAddArgs) (string, error)

func XClaim

func XClaim(ctx context.Context, a *redis.XClaimArgs) ([]redis.XMessage, error)

func XClaimJustID

func XClaimJustID(ctx context.Context, a *redis.XClaimArgs) ([]string, error)

func XDel

func XDel(ctx context.Context, stream string, ids ...string) (int64, error)

func XGroupCreate

func XGroupCreate(ctx context.Context, stream, group, start string) (string, error)

func XGroupCreateMkStream

func XGroupCreateMkStream(ctx context.Context, stream, group, start string) (string, error)

func XGroupDelConsumer

func XGroupDelConsumer(ctx context.Context, stream, group, consumer string) (int64, error)

func XGroupDestroy

func XGroupDestroy(ctx context.Context, stream, group string) (int64, error)

func XGroupSetID

func XGroupSetID(ctx context.Context, stream, group, start string) (string, error)

func XInfoGroups

func XInfoGroups(ctx context.Context, key string) ([]redis.XInfoGroup, error)

func XInfoStream

func XInfoStream(ctx context.Context, key string) (*redis.XInfoStream, error)

func XLen

func XLen(ctx context.Context, stream string) (int64, error)

func XPending

func XPending(ctx context.Context, stream, group string) (*redis.XPending, error)

func XPendingExt

func XPendingExt(ctx context.Context, a *redis.XPendingExtArgs) ([]redis.XPendingExt, error)

func XRange

func XRange(ctx context.Context, stream, start, stop string) ([]redis.XMessage, error)

func XRangeN

func XRangeN(ctx context.Context, stream, start, stop string, count int64) ([]redis.XMessage, error)

func XRead

func XRead(ctx context.Context, a *redis.XReadArgs) ([]redis.XStream, error)

func XReadGroup

func XReadGroup(ctx context.Context, a *redis.XReadGroupArgs) ([]redis.XStream, error)

func XReadStreams

func XReadStreams(ctx context.Context, streams ...string) ([]redis.XStream, error)

func XRevRange

func XRevRange(ctx context.Context, stream string, start, stop string) ([]redis.XMessage, error)

func XRevRangeN

func XRevRangeN(ctx context.Context, stream string, start, stop string, count int64) ([]redis.XMessage, error)

func XTrim

func XTrim(ctx context.Context, key string, maxLen int64) (int64, error)

func XTrimApprox

func XTrimApprox(ctx context.Context, key string, maxLen int64) (int64, error)

func ZAdd

func ZAdd(ctx context.Context, key string, members ...*redis.Z) (int64, error)

func ZAddCh

func ZAddCh(ctx context.Context, key string, members ...*redis.Z) (int64, error)

func ZAddNX

func ZAddNX(ctx context.Context, key string, members ...*redis.Z) (int64, error)

func ZAddNXCh

func ZAddNXCh(ctx context.Context, key string, members ...*redis.Z) (int64, error)

func ZAddXX

func ZAddXX(ctx context.Context, key string, members ...*redis.Z) (int64, error)

func ZAddXXCh

func ZAddXXCh(ctx context.Context, key string, members ...*redis.Z) (int64, error)

func ZCard

func ZCard(ctx context.Context, key string) (int64, error)

func ZCount

func ZCount(ctx context.Context, key, min, max string) (int64, error)

func ZIncr

func ZIncr(ctx context.Context, key string, member *redis.Z) (float64, error)

func ZIncrBy

func ZIncrBy(ctx context.Context, key string, increment float64, member string) (float64, error)

func ZIncrNX

func ZIncrNX(ctx context.Context, key string, member *redis.Z) (float64, error)

func ZIncrXX

func ZIncrXX(ctx context.Context, key string, member *redis.Z) (float64, error)

func ZInterStore

func ZInterStore(ctx context.Context, destination string, store *redis.ZStore) (int64, error)

func ZLexCount

func ZLexCount(ctx context.Context, key, min, max string) (int64, error)

func ZMScore

func ZMScore(ctx context.Context, key string, members ...string) ([]float64, error)

func ZPopMax

func ZPopMax(ctx context.Context, key string, count ...int64) ([]redis.Z, error)

func ZPopMin

func ZPopMin(ctx context.Context, key string, count ...int64) ([]redis.Z, error)

func ZRange

func ZRange(ctx context.Context, key string, start, stop int64) ([]string, error)

func ZRangeByLex

func ZRangeByLex(ctx context.Context, key string, opt *redis.ZRangeBy) ([]string, error)

func ZRangeByScore

func ZRangeByScore(ctx context.Context, key string, opt *redis.ZRangeBy) ([]string, error)

func ZRangeByScoreWithScores

func ZRangeByScoreWithScores(ctx context.Context, key string, opt *redis.ZRangeBy) ([]redis.Z, error)

func ZRangeWithScores

func ZRangeWithScores(ctx context.Context, key string, start, stop int64) ([]redis.Z, error)

func ZRank

func ZRank(ctx context.Context, key, member string) (int64, error)

func ZRem

func ZRem(ctx context.Context, key string, members ...interface{}) (int64, error)

func ZRemRangeByLex

func ZRemRangeByLex(ctx context.Context, key, min, max string) (int64, error)

func ZRemRangeByRank

func ZRemRangeByRank(ctx context.Context, key string, start, stop int64) (int64, error)

func ZRemRangeByScore

func ZRemRangeByScore(ctx context.Context, key, min, max string) (int64, error)

func ZRevRange

func ZRevRange(ctx context.Context, key string, start, stop int64) ([]string, error)

func ZRevRangeByLex

func ZRevRangeByLex(ctx context.Context, key string, opt *redis.ZRangeBy) ([]string, error)

func ZRevRangeByScore

func ZRevRangeByScore(ctx context.Context, key string, opt *redis.ZRangeBy) ([]string, error)

func ZRevRangeByScoreWithScores

func ZRevRangeByScoreWithScores(ctx context.Context, key string, opt *redis.ZRangeBy) ([]redis.Z, error)

func ZRevRangeWithScores

func ZRevRangeWithScores(ctx context.Context, key string, start, stop int64) ([]redis.Z, error)

func ZRevRank

func ZRevRank(ctx context.Context, key, member string) (int64, error)

func ZScan

func ZScan(ctx context.Context, key string, cursor uint64, match string, count int64) ([]string, uint64, error)

func ZScore

func ZScore(ctx context.Context, key, member string) (float64, error)

func ZUnionStore

func ZUnionStore(ctx context.Context, dest string, store *redis.ZStore) (int64, error)

Types

type MetricsPipeline

type MetricsPipeline struct {
	*Redis
}

func GetClusterPipeline

func GetClusterPipeline() *MetricsPipeline

func (*MetricsPipeline) Exec

func (c *MetricsPipeline) Exec(ctx context.Context) ([]redis.Cmder, error)

type Redis

type Redis struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL