Skip to content

Commit 0a57079

Browse files
committed
feat: v8 remove redis7 command
Signed-off-by: monkey92t <[email protected]>
1 parent 5c486cf commit 0a57079

File tree

1 file changed

+19
-29
lines changed

1 file changed

+19
-29
lines changed

commands.go

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
// otherwise you will receive an error: (error) ERR syntax error.
1414
// For example:
1515
//
16-
// rdb.Set(ctx, key, value, redis.KeepTTL)
16+
// rdb.Set(ctx, key, value, redis.KeepTTL)
1717
const KeepTTL = -1
1818

1919
func usePrecise(dur time.Duration) bool {
@@ -96,10 +96,6 @@ type Cmdable interface {
9696
Exists(ctx context.Context, keys ...string) *IntCmd
9797
Expire(ctx context.Context, key string, expiration time.Duration) *BoolCmd
9898
ExpireAt(ctx context.Context, key string, tm time.Time) *BoolCmd
99-
ExpireNX(ctx context.Context, key string, expiration time.Duration) *BoolCmd
100-
ExpireXX(ctx context.Context, key string, expiration time.Duration) *BoolCmd
101-
ExpireGT(ctx context.Context, key string, expiration time.Duration) *BoolCmd
102-
ExpireLT(ctx context.Context, key string, expiration time.Duration) *BoolCmd
10399
Keys(ctx context.Context, pattern string) *StringSliceCmd
104100
Migrate(ctx context.Context, host, port, key string, db int, timeout time.Duration) *StatusCmd
105101
Move(ctx context.Context, key string, db int) *BoolCmd
@@ -534,22 +530,6 @@ func (c cmdable) Expire(ctx context.Context, key string, expiration time.Duratio
534530
return c.expire(ctx, key, expiration, "")
535531
}
536532

537-
func (c cmdable) ExpireNX(ctx context.Context, key string, expiration time.Duration) *BoolCmd {
538-
return c.expire(ctx, key, expiration, "NX")
539-
}
540-
541-
func (c cmdable) ExpireXX(ctx context.Context, key string, expiration time.Duration) *BoolCmd {
542-
return c.expire(ctx, key, expiration, "XX")
543-
}
544-
545-
func (c cmdable) ExpireGT(ctx context.Context, key string, expiration time.Duration) *BoolCmd {
546-
return c.expire(ctx, key, expiration, "GT")
547-
}
548-
549-
func (c cmdable) ExpireLT(ctx context.Context, key string, expiration time.Duration) *BoolCmd {
550-
return c.expire(ctx, key, expiration, "LT")
551-
}
552-
553533
func (c cmdable) expire(
554534
ctx context.Context, key string, expiration time.Duration, mode string,
555535
) *BoolCmd {
@@ -2049,8 +2029,10 @@ func xClaimArgs(a *XClaimArgs) []interface{} {
20492029

20502030
// xTrim If approx is true, add the "~" parameter, otherwise it is the default "=" (redis default).
20512031
// example:
2052-
// XTRIM key MAXLEN/MINID threshold LIMIT limit.
2053-
// XTRIM key MAXLEN/MINID ~ threshold LIMIT limit.
2032+
//
2033+
// XTRIM key MAXLEN/MINID threshold LIMIT limit.
2034+
// XTRIM key MAXLEN/MINID ~ threshold LIMIT limit.
2035+
//
20542036
// The redis-server version is lower than 6.2, please set limit to 0.
20552037
func (c cmdable) xTrim(
20562038
ctx context.Context, key, strategy string,
@@ -2298,6 +2280,7 @@ func (c cmdable) ZAddXX(ctx context.Context, key string, members ...*Z) *IntCmd
22982280

22992281
// ZAddCh Redis `ZADD key CH score member [score member ...]` command.
23002282
// Deprecated: Use
2283+
//
23012284
// client.ZAddArgs(ctx, ZAddArgs{
23022285
// Ch: true,
23032286
// Members: []Z,
@@ -2311,6 +2294,7 @@ func (c cmdable) ZAddCh(ctx context.Context, key string, members ...*Z) *IntCmd
23112294

23122295
// ZAddNXCh Redis `ZADD key NX CH score member [score member ...]` command.
23132296
// Deprecated: Use
2297+
//
23142298
// client.ZAddArgs(ctx, ZAddArgs{
23152299
// NX: true,
23162300
// Ch: true,
@@ -2326,6 +2310,7 @@ func (c cmdable) ZAddNXCh(ctx context.Context, key string, members ...*Z) *IntCm
23262310

23272311
// ZAddXXCh Redis `ZADD key XX CH score member [score member ...]` command.
23282312
// Deprecated: Use
2313+
//
23292314
// client.ZAddArgs(ctx, ZAddArgs{
23302315
// XX: true,
23312316
// Ch: true,
@@ -2341,6 +2326,7 @@ func (c cmdable) ZAddXXCh(ctx context.Context, key string, members ...*Z) *IntCm
23412326

23422327
// ZIncr Redis `ZADD key INCR score member` command.
23432328
// Deprecated: Use
2329+
//
23442330
// client.ZAddArgsIncr(ctx, ZAddArgs{
23452331
// Members: []Z,
23462332
// })
@@ -2353,6 +2339,7 @@ func (c cmdable) ZIncr(ctx context.Context, key string, member *Z) *FloatCmd {
23532339

23542340
// ZIncrNX Redis `ZADD key NX INCR score member` command.
23552341
// Deprecated: Use
2342+
//
23562343
// client.ZAddArgsIncr(ctx, ZAddArgs{
23572344
// NX: true,
23582345
// Members: []Z,
@@ -2367,6 +2354,7 @@ func (c cmdable) ZIncrNX(ctx context.Context, key string, member *Z) *FloatCmd {
23672354

23682355
// ZIncrXX Redis `ZADD key XX INCR score member` command.
23692356
// Deprecated: Use
2357+
//
23702358
// client.ZAddArgsIncr(ctx, ZAddArgs{
23712359
// XX: true,
23722360
// Members: []Z,
@@ -2488,11 +2476,13 @@ func (c cmdable) ZPopMin(ctx context.Context, key string, count ...int64) *ZSlic
24882476

24892477
// ZRangeArgs is all the options of the ZRange command.
24902478
// In version> 6.2.0, you can replace the(cmd):
2491-
// ZREVRANGE,
2492-
// ZRANGEBYSCORE,
2493-
// ZREVRANGEBYSCORE,
2494-
// ZRANGEBYLEX,
2495-
// ZREVRANGEBYLEX.
2479+
//
2480+
// ZREVRANGE,
2481+
// ZRANGEBYSCORE,
2482+
// ZREVRANGEBYSCORE,
2483+
// ZRANGEBYLEX,
2484+
// ZREVRANGEBYLEX.
2485+
//
24962486
// Please pay attention to your redis-server version.
24972487
//
24982488
// Rev, ByScore, ByLex and Offset+Count options require redis-server 6.2.0 and higher.
@@ -2897,7 +2887,7 @@ func (c cmdable) ClientKill(ctx context.Context, ipPort string) *StatusCmd {
28972887

28982888
// ClientKillByFilter is new style syntax, while the ClientKill is old
28992889
//
2900-
// CLIENT KILL <option> [value] ... <option> [value]
2890+
// CLIENT KILL <option> [value] ... <option> [value]
29012891
func (c cmdable) ClientKillByFilter(ctx context.Context, keys ...string) *IntCmd {
29022892
args := make([]interface{}, 2+len(keys))
29032893
args[0] = "client"

0 commit comments

Comments
 (0)