mirror of
https://github.com/redis/go-redis.git
synced 2025-07-29 17:41:15 +03:00
Add basic BITFIELD support
This commit is contained in:
11
commands.go
11
commands.go
@ -98,6 +98,7 @@ type Cmdable interface {
|
||||
BitOpXor(destKey string, keys ...string) *IntCmd
|
||||
BitOpNot(destKey string, key string) *IntCmd
|
||||
BitPos(key string, bit int64, pos ...int64) *IntCmd
|
||||
BitField(key string, args ...interface{}) *IntSliceCmd
|
||||
Decr(key string) *IntCmd
|
||||
DecrBy(key string, decrement int64) *IntCmd
|
||||
Get(key string) *StringCmd
|
||||
@ -724,6 +725,16 @@ func (c cmdable) BitPos(key string, bit int64, pos ...int64) *IntCmd {
|
||||
return cmd
|
||||
}
|
||||
|
||||
func (c cmdable) BitField(key string, args ...interface{}) *IntSliceCmd {
|
||||
a := make([]interface{}, 0, 2+len(args))
|
||||
a = append(a, "bitfield")
|
||||
a = append(a, key)
|
||||
a = append(a, args...)
|
||||
cmd := NewIntSliceCmd(a...)
|
||||
c(cmd)
|
||||
return cmd
|
||||
}
|
||||
|
||||
func (c cmdable) Decr(key string) *IntCmd {
|
||||
cmd := NewIntCmd("decr", key)
|
||||
c(cmd)
|
||||
|
Reference in New Issue
Block a user