-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommands.go
217 lines (215 loc) · 14.8 KB
/
commands.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
package redis
import (
"context"
"github.com/go-redis/redis/v8"
"time"
)
type Commander interface {
Ping(ctx context.Context) (string, error)
Migrate(ctx context.Context, host, port, key string, db int, timeout time.Duration) (string, error)
Move(ctx context.Context, key string, db int) (bool, error)
Exists(ctx context.Context, keys ...string) (int64, error)
Expire(ctx context.Context, key string, expiration time.Duration) (bool, error)
Keys(ctx context.Context, pattern string) ([]string, error)
Del(ctx context.Context, keys ...string) (int64, error)
ObjectRefCount(ctx context.Context, key string) (int64, error)
ObjectEncoding(ctx context.Context, key string) (string, error)
ObjectIdleTime(ctx context.Context, key string) (time.Duration, error)
Persist(ctx context.Context, key string) (bool, error)
PExpire(ctx context.Context, key string, expiration time.Duration) (bool, error)
PTTL(ctx context.Context, key string) (time.Duration, error)
RandomKey(ctx context.Context) (string, error)
Rename(ctx context.Context, key, newkey string) (string, error)
Restore(ctx context.Context, key string, ttl time.Duration, value string) (string, error)
RestoreReplace(ctx context.Context, key string, ttl time.Duration, value string) (string, error)
Touch(ctx context.Context, keys ...string) (int64, error)
TTL(ctx context.Context, key string) (time.Duration, error)
Append(ctx context.Context, key, value string) (int64, error)
Decr(ctx context.Context, key string) (int64, error)
DecrBy(ctx context.Context, key string, decrement int64) (int64, error)
Get(ctx context.Context, key string) (string, error)
GetRange(ctx context.Context, key string, start, end int64) (string, error)
GetSet(ctx context.Context, key string, value interface{}) (string, error)
GetEx(ctx context.Context, key string, expiration time.Duration) (string, error)
GetDel(ctx context.Context, key string) (string, error)
Incr(ctx context.Context, key string) (int64, error)
IncrBy(ctx context.Context, key string, value int64) (int64, error)
IncrByFloat(ctx context.Context, key string, value float64) (float64, error)
MGet(ctx context.Context, keys ...string) ([]interface{}, error)
MSet(ctx context.Context, values ...interface{}) (string, error)
MSetNX(ctx context.Context, values ...interface{}) (bool, error)
Set(ctx context.Context, key string, value interface{}, expiration time.Duration) (string, error)
SetEX(ctx context.Context, key string, value interface{}, expiration time.Duration) (string, error)
SetNX(ctx context.Context, key string, value interface{}, expiration time.Duration) (bool, error)
SetXX(ctx context.Context, key string, value interface{}, expiration time.Duration) (bool, error)
SetRange(ctx context.Context, key string, offset int64, value string) (int64, error)
StrLen(ctx context.Context, key string) (int64, error)
Copy(ctx context.Context, sourceKey string, destKey string, db int, replace bool) (int64, error)
GetBit(ctx context.Context, key string, offset int64) (int64, error)
SetBit(ctx context.Context, key string, offset int64, value int) (int64, error)
BitOpAnd(ctx context.Context, destKey string, keys ...string) (int64, error)
BitOpOr(ctx context.Context, destKey string, keys ...string) (int64, error)
BitOpXor(ctx context.Context, destKey string, keys ...string) (int64, error)
BitOpNot(ctx context.Context, destKey string, key string) (int64, error)
BitPos(ctx context.Context, key string, bit int64, pos ...int64) (int64, error)
BitField(ctx context.Context, key string, args ...interface{}) ([]int64, error)
Scan(ctx context.Context, cursor uint64, match string, count int64) ([]string, uint64, error)
ScanType(ctx context.Context, cursor uint64, match string, count int64, keyType string) ([]string, uint64, error)
SScan(ctx context.Context, key string, cursor uint64, match string, count int64) ([]string, uint64, error)
HScan(ctx context.Context, key string, cursor uint64, match string, count int64) ([]string, uint64, error)
ZScan(ctx context.Context, key string, cursor uint64, match string, count int64) ([]string, uint64, error)
HDel(ctx context.Context, key string, fields ...string) (int64, error)
HExists(ctx context.Context, key, field string) (bool, error)
HGet(ctx context.Context, key, field string) (string, error)
HGetAll(ctx context.Context, key string) (map[string]string, error)
HIncrBy(ctx context.Context, key, field string, incr int64) (int64, error)
HIncrByFloat(ctx context.Context, key, field string, incr float64) (float64, error)
HKeys(ctx context.Context, key string) ([]string, error)
HLen(ctx context.Context, key string) (int64, error)
HMGet(ctx context.Context, key string, fields ...string) ([]interface{}, error)
HSet(ctx context.Context, key string, values ...interface{}) (int64, error)
HMSet(ctx context.Context, key string, values ...interface{}) (bool, error)
HSetNX(ctx context.Context, key, field string, value interface{}) (bool, error)
HVals(ctx context.Context, key string) ([]string, error)
HRandField(ctx context.Context, key string, count int, withValues bool) ([]string, error)
BLPop(ctx context.Context, timeout time.Duration, keys ...string) ([]string, error)
BRPop(ctx context.Context, timeout time.Duration, keys ...string) ([]string, error)
BRPopLPush(ctx context.Context, source, destination string, timeout time.Duration) (string, error)
LIndex(ctx context.Context, key string, index int64) (string, error)
LInsert(ctx context.Context, key, op string, pivot, value interface{}) (int64, error)
LInsertBefore(ctx context.Context, key string, pivot, value interface{}) (int64, error)
LInsertAfter(ctx context.Context, key string, pivot, value interface{}) (int64, error)
LLen(ctx context.Context, key string) (int64, error)
LPop(ctx context.Context, key string) (string, error)
LPopCount(ctx context.Context, key string, count int) ([]string, error)
LPush(ctx context.Context, key string, values ...interface{}) (int64, error)
LPushX(ctx context.Context, key string, values ...interface{}) (int64, error)
LRange(ctx context.Context, key string, start, stop int64) ([]string, error)
LRem(ctx context.Context, key string, count int64, value interface{}) (int64, error)
LSet(ctx context.Context, key string, index int64, value interface{}) (string, error)
LTrim(ctx context.Context, key string, start, stop int64) (string, error)
RPop(ctx context.Context, key string) (string, error)
RPopCount(ctx context.Context, key string, count int) ([]string, error)
RPopLPush(ctx context.Context, source, destination string) (string, error)
RPush(ctx context.Context, key string, values ...interface{}) (int64, error)
RPushX(ctx context.Context, key string, values ...interface{}) (int64, error)
LMove(ctx context.Context, source, destination, srcpos, destpos string) (string, error)
BLMove(ctx context.Context, source, destination, srcpos, destpos string, timeout time.Duration) (string, error)
SAdd(ctx context.Context, key string, members ...interface{}) (int64, error)
SCard(ctx context.Context, key string) (int64, error)
SDiff(ctx context.Context, keys ...string) ([]string, error)
SDiffStore(ctx context.Context, destination string, keys ...string) (int64, error)
SInter(ctx context.Context, keys ...string) ([]string, error)
SInterStore(ctx context.Context, destination string, keys ...string) (int64, error)
SIsMember(ctx context.Context, key string, member interface{}) (bool, error)
SMIsMember(ctx context.Context, key string, members ...interface{}) ([]bool, error)
SMembers(ctx context.Context, key string) ([]string, error)
SMembersMap(ctx context.Context, key string) (map[string]struct{}, error)
SMove(ctx context.Context, source, destination string, member interface{}) (bool, error)
SPop(ctx context.Context, key string) (string, error)
SPopN(ctx context.Context, key string, count int64) ([]string, error)
SRandMember(ctx context.Context, key string) (string, error)
SRandMemberN(ctx context.Context, key string, count int64) ([]string, error)
SRem(ctx context.Context, key string, members ...interface{}) (int64, error)
SUnion(ctx context.Context, keys ...string) ([]string, error)
SUnionStore(ctx context.Context, destination string, keys ...string) (int64, error)
XDel(ctx context.Context, stream string, ids ...string) (int64, error)
XLen(ctx context.Context, stream string) (int64, error)
XRange(ctx context.Context, stream, start, stop string) ([]redis.XMessage, error)
XRangeN(ctx context.Context, stream, start, stop string, count int64) ([]redis.XMessage, error)
XRevRange(ctx context.Context, stream, start, stop string) ([]redis.XMessage, error)
XRevRangeN(ctx context.Context, stream, start, stop string, count int64) ([]redis.XMessage, error)
XReadStreams(ctx context.Context, streams ...string) ([]redis.XStream, error)
XGroupCreate(ctx context.Context, stream, group, start string) (string, error)
XGroupCreateMkStream(ctx context.Context, stream, group, start string) (string, error)
XGroupSetID(ctx context.Context, stream, group, start string) (string, error)
XGroupDestroy(ctx context.Context, stream, group string) (int64, error)
XGroupCreateConsumer(ctx context.Context, stream, group, consumer string) (int64, error)
XGroupDelConsumer(ctx context.Context, stream, group, consumer string) (int64, error)
XAck(ctx context.Context, stream, group string, ids ...string) (int64, error)
XPending(ctx context.Context, stream, group string) (*redis.XPending, error)
XTrim(ctx context.Context, key string, maxLen int64) (int64, error)
XTrimApprox(ctx context.Context, key string, maxLen int64) (int64, error)
XTrimMaxLen(ctx context.Context, key string, maxLen int64) (int64, error)
XTrimMaxLenApprox(ctx context.Context, key string, maxLen, limit int64) (int64, error)
XTrimMinID(ctx context.Context, key string, minID string) (int64, error)
XTrimMinIDApprox(ctx context.Context, key string, minID string, limit int64) (int64, error)
ZAdd(ctx context.Context, key string, members ...*Z) (int64, error)
ZAddNX(ctx context.Context, key string, members ...*Z) (int64, error)
ZAddXX(ctx context.Context, key string, members ...*Z) (int64, error)
ZIncr(ctx context.Context, key string, member *Z) (float64, error)
ZIncrNX(ctx context.Context, key string, member *Z) (float64, error)
ZIncrXX(ctx context.Context, key string, member *Z) (float64, error)
ZCard(ctx context.Context, key string) (int64, error)
ZCount(ctx context.Context, key, min, max string) (int64, error)
ZLexCount(ctx context.Context, key, min, max string) (int64, error)
ZIncrBy(ctx context.Context, key string, increment float64, member string) (float64, error)
ZInter(ctx context.Context, store *ZStore) ([]string, error)
ZInterWithScores(ctx context.Context, store *ZStore) ([]Z, error)
ZInterStore(ctx context.Context, destination string, store *ZStore) (int64, error)
ZMScore(ctx context.Context, key string, members ...string) ([]float64, error)
ZPopMax(ctx context.Context, key string, count ...int64) ([]Z, error)
ZPopMin(ctx context.Context, key string, count ...int64) ([]Z, error)
ZRange(ctx context.Context, key string, start, stop int64) ([]string, error)
ZRangeWithScores(ctx context.Context, key string, start, stop int64) ([]Z, error)
ZRangeByScore(ctx context.Context, key string, opt *ZRangeBy) ([]string, error)
ZRangeByLex(ctx context.Context, key string, opt *ZRangeBy) ([]string, error)
ZRangeByScoreWithScores(ctx context.Context, key string, opt *ZRangeBy) ([]Z, error)
ZRank(ctx context.Context, key, member string) (int64, error)
ZRem(ctx context.Context, key string, members ...interface{}) (int64, error)
ZRemRangeByRank(ctx context.Context, key string, start, stop int64) (int64, error)
ZRemRangeByScore(ctx context.Context, key, min, max string) (int64, error)
ZRemRangeByLex(ctx context.Context, key, min, max string) (int64, error)
ZRevRange(ctx context.Context, key string, start, stop int64) ([]string, error)
ZRevRangeWithScores(ctx context.Context, key string, start, stop int64) ([]Z, error)
ZRevRank(ctx context.Context, key, member string) (int64, error)
ZScore(ctx context.Context, key, member string) (float64, error)
ZUnionStore(ctx context.Context, dest string, store *ZStore) (int64, error)
ZUnion(ctx context.Context, store ZStore) ([]string, error)
ZUnionWithScores(ctx context.Context, store ZStore) ([]Z, error)
ZRandMember(ctx context.Context, key string, count int, withScores bool) ([]string, error)
ZDiff(ctx context.Context, keys ...string) ([]string, error)
ZDiffWithScores(ctx context.Context, keys ...string) ([]Z, error)
ZDiffStore(ctx context.Context, destination string, keys ...string) (int64, error)
PFAdd(ctx context.Context, key string, els ...interface{}) (int64, error)
PFCount(ctx context.Context, keys ...string) (int64, error)
PFMerge(ctx context.Context, dest string, keys ...string) (string, error)
BgRewriteAOF(ctx context.Context) (string, error)
BgSave(ctx context.Context) (string, error)
ClientKill(ctx context.Context, ipPort string) (string, error)
ClientKillByFilter(ctx context.Context, keys ...string) (int64, error)
ClientList(ctx context.Context) (string, error)
ClientPause(ctx context.Context, dur time.Duration) (bool, error)
ClientID(ctx context.Context) (int64, error)
ConfigGet(ctx context.Context, parameter string) ([]interface{}, error)
ConfigResetStat(ctx context.Context) (string, error)
ConfigSet(ctx context.Context, parameter, value string) (string, error)
ConfigRewrite(ctx context.Context) (string, error)
DBSize(ctx context.Context) (int64, error)
FlushAll(ctx context.Context) (string, error)
FlushAllAsync(ctx context.Context) (string, error)
FlushDB(ctx context.Context) (string, error)
FlushDBAsync(ctx context.Context) (string, error)
Info(ctx context.Context, section ...string) (string, error)
LastSave(ctx context.Context) (int64, error)
Save(ctx context.Context) (string, error)
Shutdown(ctx context.Context) (string, error)
ShutdownSave(ctx context.Context) (string, error)
ShutdownNoSave(ctx context.Context) (string, error)
SlaveOf(ctx context.Context, host, port string) (string, error)
Time(ctx context.Context) (time.Time, error)
DebugObject(ctx context.Context, key string) (string, error)
ReadOnly(ctx context.Context) (string, error)
ReadWrite(ctx context.Context) (string, error)
MemoryUsage(ctx context.Context, key string, samples ...int) (int64, error)
Eval(ctx context.Context, script string, keys []string, args ...interface{}) (interface{}, error)
EvalSha(ctx context.Context, sha1 string, keys []string, args ...interface{}) (interface{}, error)
ScriptExists(ctx context.Context, hashes ...string) ([]bool, error)
ScriptFlush(ctx context.Context) (string, error)
ScriptKill(ctx context.Context) (string, error)
ScriptLoad(ctx context.Context, script string) (string, error)
Publish(ctx context.Context, channel string, message interface{}) (int64, error)
PubSubChannels(ctx context.Context, pattern string) ([]string, error)
PubSubNumSub(ctx context.Context, channels ...string) (map[string]int64, error)
PubSubNumPat(ctx context.Context) (int64, error)
}