From 95b6b11f3264f6c0617f9b5a39b102427337983e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 31 May 2026 00:46:36 +0000 Subject: [PATCH] chore(deps): bump github.com/alicebob/miniredis/v2 from 2.37.0 to 2.38.0 Bumps [github.com/alicebob/miniredis/v2](https://github.com/alicebob/miniredis) from 2.37.0 to 2.38.0. - [Release notes](https://github.com/alicebob/miniredis/releases) - [Changelog](https://github.com/alicebob/miniredis/blob/master/CHANGELOG.md) - [Commits](https://github.com/alicebob/miniredis/compare/v2.37.0...v2.38.0) --- updated-dependencies: - dependency-name: github.com/alicebob/miniredis/v2 dependency-version: 2.38.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 5 +- .../alicebob/miniredis/v2/CHANGELOG.md | 10 ++- .../alicebob/miniredis/v2/README.md | 23 +++--- .../alicebob/miniredis/v2/cmd_scripting.go | 23 +++--- .../alicebob/miniredis/v2/cmd_stream.go | 12 +-- .../alicebob/miniredis/v2/cmd_string.go | 81 ++++++++++++++++++- .../alicebob/miniredis/v2/stream.go | 1 + vendor/modules.txt | 2 +- 9 files changed, 124 insertions(+), 35 deletions(-) diff --git a/go.mod b/go.mod index c9dc478b8..9b1809c71 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( require ( github.com/alecthomas/kong v1.15.0 - github.com/alicebob/miniredis/v2 v2.37.0 + github.com/alicebob/miniredis/v2 v2.38.0 github.com/aws/aws-sdk-go-v2 v1.41.7 github.com/aws/aws-sdk-go-v2/config v1.32.17 github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.23 diff --git a/go.sum b/go.sum index 5010a799d..89629f7ed 100644 --- a/go.sum +++ b/go.sum @@ -19,8 +19,8 @@ github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuy github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alicebob/miniredis/v2 v2.37.0 h1:RheObYW32G1aiJIj81XVt78ZHJpHonHLHW7OLIshq68= -github.com/alicebob/miniredis/v2 v2.37.0/go.mod h1:TcL7YfarKPGDAthEtl5NBeHZfeUQj6OXMm/+iu5cLMM= +github.com/alicebob/miniredis/v2 v2.38.0 h1:nZAzCR+Lj+Vxk4ZXzm2NuKq2O33RXj1XxJ2e2uP9jiw= +github.com/alicebob/miniredis/v2 v2.38.0/go.mod h1:TcL7YfarKPGDAthEtl5NBeHZfeUQj6OXMm/+iu5cLMM= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= @@ -473,6 +473,7 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= +gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls= google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:+rXWjjaukWZun3mLfjmVnQi18E1AsFbDN9QdJ5YXLto= google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww= diff --git a/vendor/github.com/alicebob/miniredis/v2/CHANGELOG.md b/vendor/github.com/alicebob/miniredis/v2/CHANGELOG.md index 2c8cb85f1..9b753d013 100644 --- a/vendor/github.com/alicebob/miniredis/v2/CHANGELOG.md +++ b/vendor/github.com/alicebob/miniredis/v2/CHANGELOG.md @@ -1,9 +1,17 @@ ## Changelog +## v2.38.0 + +- XADD TRIM (thanks @evan-choi) +- update XINFO STREAM (thanks @TomBailey167) +- lua fix (thanks @infastin) +- partial support for DELEX + + ## v2.37.0 -- suport HEXPIRE (thanks @mojixcoder) +- support HEXPIRE (thanks @mojixcoder) ## v2.36.1 diff --git a/vendor/github.com/alicebob/miniredis/v2/README.md b/vendor/github.com/alicebob/miniredis/v2/README.md index b2282ffb1..78e4d3247 100644 --- a/vendor/github.com/alicebob/miniredis/v2/README.md +++ b/vendor/github.com/alicebob/miniredis/v2/README.md @@ -25,7 +25,7 @@ import "github.com/alicebob/miniredis/v2" Implemented commands: - - Connection (complete) + - Connection - AUTH -- see RequireAuth() - ECHO - HELLO -- see RequireUserAuth() @@ -58,7 +58,7 @@ Implemented commands: - TYPE - UNLINK - WAIT -- no-op - - Transactions (complete) + - Transactions - DISCARD - EXEC - MULTI @@ -71,19 +71,20 @@ Implemented commands: - TIME -- returns time.Now() or value set by SetTime() - COMMAND -- partly - INFO -- partly, returns only "clients" section with one field "connected_clients" - - String keys (complete) + - String keys - APPEND - BITCOUNT - BITOP - BITPOS - DECR - DECRBY + - DELEX -- partly - GET - GETBIT - - GETRANGE - - GETSET - GETDEL - GETEX + - GETRANGE + - GETSET - INCR - INCRBY - INCRBYFLOAT @@ -97,7 +98,7 @@ Implemented commands: - SETNX - SETRANGE - STRLEN - - Hash keys (complete) + - Hash keys - HDEL - HEXISTS - HGET @@ -114,7 +115,7 @@ Implemented commands: - HSTRLEN - HVALS - HSCAN - - List keys (complete) + - List keys - BLPOP - BRPOP - BRPOPLPUSH @@ -134,14 +135,14 @@ Implemented commands: - RPUSHX - LMOVE - BLMOVE - - Pub/Sub (complete) + - Pub/Sub - PSUBSCRIBE - PUBLISH - PUBSUB - PUNSUBSCRIBE - SUBSCRIBE - UNSUBSCRIBE - - Set keys (complete) + - Set keys - SADD - SCARD - SDIFF @@ -159,7 +160,7 @@ Implemented commands: - SSCAN - SUNION - SUNIONSTORE - - Sorted Set keys (complete) + - Sorted Set keys - ZADD - ZCARD - ZCOUNT @@ -226,7 +227,7 @@ Implemented commands: - CLUSTER KEYSLOT - CLUSTER NODES - CLUSTER SHARDS - - HyperLogLog (complete) + - HyperLogLog - PFADD - PFCOUNT - PFMERGE diff --git a/vendor/github.com/alicebob/miniredis/v2/cmd_scripting.go b/vendor/github.com/alicebob/miniredis/v2/cmd_scripting.go index 32705b858..5b475c5f9 100644 --- a/vendor/github.com/alicebob/miniredis/v2/cmd_scripting.go +++ b/vendor/github.com/alicebob/miniredis/v2/cmd_scripting.go @@ -88,22 +88,21 @@ func (m *Miniredis) runLuaScript(c *server.Peer, sha, script string, readOnly bo l.SetGlobal("ARGV", argvTable) redisFuncs, redisConstants := mkLua(m.srv, c, sha, readOnly) - // Register command handlers - l.Push(l.NewFunction(func(l *lua.LState) int { - mod := l.RegisterModule("redis", redisFuncs).(*lua.LTable) - for k, v := range redisConstants { - mod.RawSetString(k, v) - } - l.Push(mod) - return 1 - })) + redisMod := l.CreateTable(0, len(redisFuncs)+len(redisConstants)) + for fname, fn := range redisFuncs { + redisMod.RawSetString(fname, l.NewFunction(fn)) + } + for k, v := range redisConstants { + redisMod.RawSetString(k, v) + } + for _, name := range []string{"redis", "server"} { + l.SetGlobal(name, redisMod) + } + l.RegisterModule("os", mkLuaOS()) _ = doScript(l, protectGlobals) - l.Push(lua.LString("redis")) - l.Call(1, 0) - // lua can call redis.setresp(...), but it's tmp state. oldresp := c.Resp3 if err := doScript(l, script); err != nil { diff --git a/vendor/github.com/alicebob/miniredis/v2/cmd_stream.go b/vendor/github.com/alicebob/miniredis/v2/cmd_stream.go index f2cccbb51..e8d6570ca 100644 --- a/vendor/github.com/alicebob/miniredis/v2/cmd_stream.go +++ b/vendor/github.com/alicebob/miniredis/v2/cmd_stream.go @@ -49,8 +49,8 @@ func (m *Miniredis) cmdXadd(c *server.Peer, cmd string, args []string) { } if strings.ToLower(args[0]) == "maxlen" { args = args[1:] - // we don't treat "~" special - if args[0] == "~" { + // ignore exact/approximate trimming modifiers + if args[0] == "~" || args[0] == "=" { args = args[1:] } n, err := strconv.Atoi(args[0]) @@ -66,8 +66,8 @@ func (m *Miniredis) cmdXadd(c *server.Peer, cmd string, args []string) { args = args[1:] } else if strings.ToLower(args[0]) == "minid" { args = args[1:] - // we don't treat "~" special - if args[0] == "~" { + // ignore exact/approximate trimming modifiers + if args[0] == "~" || args[0] == "=" { args = args[1:] } minID = args[0] @@ -529,9 +529,11 @@ func (m *Miniredis) cmdXinfoStream(c *server.Peer, args []string) { return } - c.WriteMapLen(1) + c.WriteMapLen(2) c.WriteBulk("length") c.WriteInt(len(s.entries)) + c.WriteBulk("last-generated-id") + c.WriteBulk(s.lastAllocatedID) }) } diff --git a/vendor/github.com/alicebob/miniredis/v2/cmd_string.go b/vendor/github.com/alicebob/miniredis/v2/cmd_string.go index 61c673270..2c2ba8e0a 100644 --- a/vendor/github.com/alicebob/miniredis/v2/cmd_string.go +++ b/vendor/github.com/alicebob/miniredis/v2/cmd_string.go @@ -20,12 +20,13 @@ func commandsString(m *Miniredis) { m.srv.Register("BITPOS", m.cmdBitpos, server.ReadOnlyOption()) m.srv.Register("DECRBY", m.cmdDecrby) m.srv.Register("DECR", m.cmdDecr) + m.srv.Register("DELEX", m.cmdDelex) m.srv.Register("GETBIT", m.cmdGetbit, server.ReadOnlyOption()) - m.srv.Register("GET", m.cmdGet, server.ReadOnlyOption()) + m.srv.Register("GETDEL", m.cmdGetdel) m.srv.Register("GETEX", m.cmdGetex) + m.srv.Register("GET", m.cmdGet, server.ReadOnlyOption()) m.srv.Register("GETRANGE", m.cmdGetrange, server.ReadOnlyOption()) m.srv.Register("GETSET", m.cmdGetset) - m.srv.Register("GETDEL", m.cmdGetdel) m.srv.Register("INCRBYFLOAT", m.cmdIncrbyfloat) m.srv.Register("INCRBY", m.cmdIncrby) m.srv.Register("INCR", m.cmdIncr) @@ -1110,6 +1111,82 @@ func (m *Miniredis) cmdSetbit(c *server.Peer, cmd string, args []string) { }) } +// DELEX +func (m *Miniredis) cmdDelex(c *server.Peer, cmd string, args []string) { + if !m.isValidCMD(c, cmd, args, between(1, 4)) { + return + } + + var opts struct { + key string + opEQ bool + matchValue string + } + + // Parse arguments + if len(args) != 1 && len(args) != 3 { + c.WriteError(errWrongNumber("delex")) + return + } + + if len(args) == 3 { + opts.key = args[0] + condition := strings.ToUpper(args[1]) + opts.matchValue = args[2] + + switch condition { + case "IFEQ": + opts.opEQ = true + case "IFNE": + opts.opEQ = false // well doh + case "IFDEQ", "IFDNE": + c.WriteError("ERR unsupported condition for DELEX: " + condition) + return + default: + c.WriteError("Invalid condition. Use IFEQ, IFNE, IFDEQ, or IFDNE") + return + } + } + + withTx(m, c, func(c *server.Peer, ctx *connCtx) { + db := m.db(ctx.selectedDB) + + // If no condition is specified, behave like DEL + if opts.key == "" { + key := args[0] + if db.exists(key) { + db.del(key, true) // delete expire + c.WriteInt(1) + } else { + c.WriteInt(0) + } + return + } + + if !db.exists(opts.key) { + c.WriteInt(0) + return + } + + if db.t(opts.key) != keyTypeString { + c.WriteError("ERR Key should be of string type if conditions are specified") + return + } + currentValue := db.stringKeys[opts.key] + + shouldDelete := (currentValue == opts.matchValue) + if !opts.opEQ { + shouldDelete = !shouldDelete + } + if shouldDelete { + db.del(opts.key, true) // delete expire + c.WriteInt(1) + } else { + c.WriteInt(0) + } + }) +} + // Redis range. both start and end can be negative. func withRange(v string, start, end int) string { s, e := redisRange(len(v), start, end, true /* string getrange symantics */) diff --git a/vendor/github.com/alicebob/miniredis/v2/stream.go b/vendor/github.com/alicebob/miniredis/v2/stream.go index 27cc5209b..1f1fc9d74 100644 --- a/vendor/github.com/alicebob/miniredis/v2/stream.go +++ b/vendor/github.com/alicebob/miniredis/v2/stream.go @@ -262,6 +262,7 @@ func (s *streamKey) add(entryID string, values []string, now time.Time) (string, ID: entryID, Values: values, }) + s.lastAllocatedID = entryID return entryID, nil } diff --git a/vendor/modules.txt b/vendor/modules.txt index b77c2720d..72a6a3f4e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -19,7 +19,7 @@ github.com/Microsoft/go-winio/pkg/guid # github.com/alecthomas/kong v1.15.0 ## explicit; go 1.20 github.com/alecthomas/kong -# github.com/alicebob/miniredis/v2 v2.37.0 +# github.com/alicebob/miniredis/v2 v2.38.0 ## explicit; go 1.17 github.com/alicebob/miniredis/v2 github.com/alicebob/miniredis/v2/fpconv