@@ -138,13 +138,13 @@ type CoreCmdable interface {
138
138
BitPos (ctx context.Context , key string , bit int64 , pos ... int64 ) * IntCmd
139
139
BitPosSpan (ctx context.Context , key string , bit int64 , start , end int64 , span string ) * IntCmd
140
140
BitField (ctx context.Context , key string , args ... any ) * IntSliceCmd
141
- // TODO BitFieldRO(ctx context.Context, key string, values ...interface{} ) *IntSliceCmd
141
+ BitFieldRO (ctx context.Context , key string , values ... any ) * IntSliceCmd
142
142
143
143
Scan (ctx context.Context , cursor uint64 , match string , count int64 ) * ScanCmd
144
144
ScanType (ctx context.Context , cursor uint64 , match string , count int64 , keyType string ) * ScanCmd
145
145
SScan (ctx context.Context , key string , cursor uint64 , match string , count int64 ) * ScanCmd
146
146
HScan (ctx context.Context , key string , cursor uint64 , match string , count int64 ) * ScanCmd
147
- // TODO HScanNoValues(ctx context.Context, key string, cursor uint64, match string, count int64) *ScanCmd
147
+ HScanNoValues (ctx context.Context , key string , cursor uint64 , match string , count int64 ) * ScanCmd
148
148
ZScan (ctx context.Context , key string , cursor uint64 , match string , count int64 ) * ScanCmd
149
149
150
150
HDel (ctx context.Context , key string , fields ... string ) * IntCmd
@@ -320,7 +320,7 @@ type CoreCmdable interface {
320
320
ClientKill (ctx context.Context , ipPort string ) * StatusCmd
321
321
ClientKillByFilter (ctx context.Context , keys ... string ) * IntCmd
322
322
ClientList (ctx context.Context ) * StringCmd
323
- // TODO ClientInfo(ctx context.Context) *ClientInfoCmd
323
+ ClientInfo (ctx context.Context ) * ClientInfoCmd
324
324
ClientPause (ctx context.Context , dur time.Duration ) * BoolCmd
325
325
ClientUnpause (ctx context.Context ) * BoolCmd
326
326
ClientID (ctx context.Context ) * IntCmd
@@ -1245,6 +1245,15 @@ func (c *Compat) BitField(ctx context.Context, key string, args ...any) *IntSlic
1245
1245
return newIntSliceCmd (resp )
1246
1246
}
1247
1247
1248
+ func (c * Compat ) BitFieldRO (ctx context.Context , key string , args ... any ) * IntSliceCmd {
1249
+ cmd := c .client .B ().Arbitrary ("BITFIELD_RO" ).Keys (key )
1250
+ for i := 0 ; i < len (args ); i += 2 {
1251
+ cmd = cmd .Args ("GET" , str (args [i ]), str (args [i + 1 ]))
1252
+ }
1253
+ resp := c .client .Do (ctx , cmd .ReadOnly ())
1254
+ return newIntSliceCmd (resp )
1255
+ }
1256
+
1248
1257
func (c * Compat ) Scan (ctx context.Context , cursor uint64 , match string , count int64 ) * ScanCmd {
1249
1258
cmd := c .client .B ().Arbitrary ("SCAN" , strconv .FormatInt (int64 (cursor ), 10 ))
1250
1259
if match != "" {
@@ -1293,6 +1302,19 @@ func (c *Compat) HScan(ctx context.Context, key string, cursor uint64, match str
1293
1302
return newScanCmd (resp )
1294
1303
}
1295
1304
1305
+ func (c * Compat ) HScanNoValues (ctx context.Context , key string , cursor uint64 , match string , count int64 ) * ScanCmd {
1306
+ cmd := c .client .B ().Arbitrary ("HSCAN" ).Keys (key ).Args (strconv .FormatInt (int64 (cursor ), 10 ))
1307
+ if match != "" {
1308
+ cmd = cmd .Args ("MATCH" , match )
1309
+ }
1310
+ if count > 0 {
1311
+ cmd = cmd .Args ("COUNT" , strconv .FormatInt (count , 10 ))
1312
+ }
1313
+ cmd = cmd .Args ("NOVALUES" )
1314
+ resp := c .client .Do (ctx , cmd .ReadOnly ())
1315
+ return newScanCmd (resp )
1316
+ }
1317
+
1296
1318
func (c * Compat ) ZScan (ctx context.Context , key string , cursor uint64 , match string , count int64 ) * ScanCmd {
1297
1319
cmd := c .client .B ().Arbitrary ("ZSCAN" ).Keys (key ).Args (strconv .FormatInt (int64 (cursor ), 10 ))
1298
1320
if match != "" {
@@ -2617,6 +2639,10 @@ func (c *Compat) ClientUnblockWithError(ctx context.Context, id int64) *IntCmd {
2617
2639
return newIntCmd (c .client .Do (ctx , c .client .B ().ClientUnblock ().ClientId (id ).Error ().Build ()))
2618
2640
}
2619
2641
2642
+ func (c * Compat ) ClientInfo (ctx context.Context ) * ClientInfoCmd {
2643
+ return newClientInfoCmd (c .client .Do (ctx , c .client .B ().ClientInfo ().Build ()))
2644
+ }
2645
+
2620
2646
func (c * Compat ) ConfigGet (ctx context.Context , parameter string ) * StringStringMapCmd {
2621
2647
cmd := c .client .B ().ConfigGet ().Parameter (parameter ).Build ()
2622
2648
resp := c .client .Do (ctx , cmd )
@@ -5660,6 +5686,15 @@ func (c CacheCompat) BitPosSpan(ctx context.Context, key string, bit, start, end
5660
5686
return newIntCmd (resp )
5661
5687
}
5662
5688
5689
+ func (c CacheCompat ) BitFieldRO (ctx context.Context , key string , args ... any ) * IntSliceCmd {
5690
+ cmd := c .client .B ().Arbitrary ("BITFIELD_RO" ).Keys (key )
5691
+ for i := 0 ; i < len (args ); i += 2 {
5692
+ cmd = cmd .Args ("GET" , str (args [i ]), str (args [i + 1 ]))
5693
+ }
5694
+ resp := c .client .DoCache (ctx , rueidis .Cacheable (cmd .ReadOnly ()), c .ttl )
5695
+ return newIntSliceCmd (resp )
5696
+ }
5697
+
5663
5698
func (c CacheCompat ) EvalRO (ctx context.Context , script string , keys []string , args ... any ) * Cmd {
5664
5699
cmd := c .client .B ().EvalRo ().Script (script ).Numkeys (int64 (len (keys ))).Key (keys ... ).Arg (argsToSlice (args )... ).Cache ()
5665
5700
return newCmd (c .client .DoCache (ctx , cmd , c .ttl ))
0 commit comments