Skip to content

Commit 642e2cb

Browse files
authored
Merge branch 'master' into apply-make-fmt
2 parents 592e418 + 67824eb commit 642e2cb

24 files changed

+4322
-47
lines changed

Diff for: .github/wordlist.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,5 @@ url
5757
variadic
5858
RedisStack
5959
RedisGears
60-
RedisTimeseries
60+
RedisTimeseries
61+
RediSearch

Diff for: .github/workflows/golangci-lint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ jobs:
2323
steps:
2424
- uses: actions/checkout@v4
2525
- name: golangci-lint
26-
uses: golangci/golangci-lint-action@v4
26+
uses: golangci/golangci-lint-action@v6

Diff for: .github/workflows/spellcheck.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
- name: Checkout
99
uses: actions/checkout@v4
1010
- name: Check Spelling
11-
uses: rojopolis/spellcheck-github-actions@0.36.0
11+
uses: rojopolis/spellcheck-github-actions@0.38.0
1212
with:
1313
config_path: .github/spellcheck-settings.yml
1414
task_name: Markdown

Diff for: Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ build:
3131

3232
testdata/redis:
3333
mkdir -p $@
34-
wget -qO- https://download.redis.io/releases/redis-7.2.1.tar.gz | tar xvz --strip-components=1 -C $@
34+
wget -qO- https://download.redis.io/releases/redis-7.4-rc2.tar.gz | tar xvz --strip-components=1 -C $@
3535

3636
testdata/redis/src/redis-server: testdata/redis
3737
cd $< && make all

Diff for: command.go

+66
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,10 @@ func (cmd *StatusCmd) Result() (string, error) {
573573
return cmd.val, cmd.err
574574
}
575575

576+
func (cmd *StatusCmd) Bytes() ([]byte, error) {
577+
return util.StringToBytes(cmd.val), cmd.err
578+
}
579+
576580
func (cmd *StatusCmd) String() string {
577581
return cmdString(cmd, cmd.val)
578582
}
@@ -3783,6 +3787,65 @@ func (cmd *MapStringStringSliceCmd) readReply(rd *proto.Reader) error {
37833787
return nil
37843788
}
37853789

3790+
// -----------------------------------------------------------------------
3791+
// MapStringInterfaceCmd represents a command that returns a map of strings to interface{}.
3792+
type MapMapStringInterfaceCmd struct {
3793+
baseCmd
3794+
val map[string]interface{}
3795+
}
3796+
3797+
func NewMapMapStringInterfaceCmd(ctx context.Context, args ...interface{}) *MapMapStringInterfaceCmd {
3798+
return &MapMapStringInterfaceCmd{
3799+
baseCmd: baseCmd{
3800+
ctx: ctx,
3801+
args: args,
3802+
},
3803+
}
3804+
}
3805+
3806+
func (cmd *MapMapStringInterfaceCmd) String() string {
3807+
return cmdString(cmd, cmd.val)
3808+
}
3809+
3810+
func (cmd *MapMapStringInterfaceCmd) SetVal(val map[string]interface{}) {
3811+
cmd.val = val
3812+
}
3813+
3814+
func (cmd *MapMapStringInterfaceCmd) Result() (map[string]interface{}, error) {
3815+
return cmd.val, cmd.err
3816+
}
3817+
3818+
func (cmd *MapMapStringInterfaceCmd) Val() map[string]interface{} {
3819+
return cmd.val
3820+
}
3821+
3822+
func (cmd *MapMapStringInterfaceCmd) readReply(rd *proto.Reader) (err error) {
3823+
n, err := rd.ReadArrayLen()
3824+
if err != nil {
3825+
return err
3826+
}
3827+
3828+
data := make(map[string]interface{}, n/2)
3829+
for i := 0; i < n; i += 2 {
3830+
_, err := rd.ReadArrayLen()
3831+
if err != nil {
3832+
cmd.err = err
3833+
}
3834+
key, err := rd.ReadString()
3835+
if err != nil {
3836+
cmd.err = err
3837+
}
3838+
value, err := rd.ReadString()
3839+
if err != nil {
3840+
cmd.err = err
3841+
}
3842+
data[key] = value
3843+
}
3844+
3845+
cmd.val = data
3846+
return nil
3847+
}
3848+
37863849
//-----------------------------------------------------------------------
37873850

37883851
type MapStringInterfaceSliceCmd struct {
@@ -4997,6 +5060,7 @@ type ClientInfo struct {
49975060
PSub int // number of pattern matching subscriptions
49985061
SSub int // redis version 7.0.3, number of shard channel subscriptions
49995062
Multi int // number of commands in a MULTI/EXEC context
5063+
Watch int // redis version 7.4 RC1, number of keys this client is currently watching.
50005064
QueryBuf int // qbuf, query buffer length (0 means no query pending)
50015065
QueryBufFree int // qbuf-free, free space of the query buffer (0 means the buffer is full)
50025066
ArgvMem int // incomplete arguments for the next command (already extracted from query buffer)
@@ -5149,6 +5213,8 @@ func parseClientInfo(txt string) (info *ClientInfo, err error) {
51495213
info.SSub, err = strconv.Atoi(val)
51505214
case "multi":
51515215
info.Multi, err = strconv.Atoi(val)
5216+
case "watch":
5217+
info.Watch, err = strconv.Atoi(val)
51525218
case "qbuf":
51535219
info.QueryBuf, err = strconv.Atoi(val)
51545220
case "qbuf-free":

Diff for: commands.go

+1
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ type Cmdable interface {
220220
ProbabilisticCmdable
221221
PubSubCmdable
222222
ScriptingFunctionsCmdable
223+
SearchCmdable
223224
SetCmdable
224225
SortedSetCmdable
225226
StringCmdable

0 commit comments

Comments
 (0)