Commit Graph

247 Commits

Author SHA1 Message Date
ofekshenawa 6a584c1e2b
Support Hash-field expiration for 7.4 CE RC2 (#3040)
Co-authored-by: Monkey <golang@88.com>
Co-authored-by: Vladyslav Vildanov <117659936+vladvildanov@users.noreply.github.com>
2024-07-10 23:30:32 +08:00
b1ron 3975cd5380
Add support for XREAD last entry (#3005)
* add support for XREAD last entry

* handle reading from multiple streams

* add test to ensure we block for empty stream

* small tweak

* add an option to XReadArgs instead

* modify test comment

* small preallocation optimization

* Changed argument to generic ID, skip tests on Enterprise

* Fix test case

* Updated expiration command

---------

Co-authored-by: Vladyslav Vildanov <117659936+vladvildanov@users.noreply.github.com>
Co-authored-by: vladvildanov <divinez122@outlook.com>
2024-06-20 11:25:51 +03:00
ofekshenawa 445d2667eb
remove tests from RE (#3035) 2024-06-20 02:25:49 +03:00
Gabriel Erzse 097cddbeb0
Support NOVALUES parameter for HSCAN (#2925)
* Support NOVALUES parameter for HSCAN

Issue #2919

The NOVALUES parameter instructs HSCAN to only return the hash keys,
without values.

* Update hash_commands.go

---------

Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
2024-06-20 01:24:45 +03:00
Vladyslav Vildanov 0777247baa
Added test case for CLIENT KILL with MAXAGE option (#2971)
* Added test case for CLIENT KILL with MAXAGE option

* Fixed sleep value

* Added additional condition to kill specific connection

* Test commit

* Test commit

* Updated test case to handle timeouts

---------

Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
2024-06-20 01:00:09 +03:00
ofekshenawa a9b4c5cfe6
Support Hash-field expiration commands (#2991)
* Add HExpire command

* Add HPExpire, HexpireAt, HPExpireAt, HTTL, HPTTL, HPersist,HExpireTime, HPExpireTIme, HGetF, HSetF commands

* add docstring

* add tests and fix commands

* modify commands

* api changes

* fix tests

* remove tests from RE
2024-06-20 00:59:27 +03:00
ofekshenawa 5da49b1aba
bug: Fix SETINFO ensuring it is set-and-forget (#2915)
* Exexcute set-info without validation

* Fix tests

* Remove spaces from runtime.Version

* fix typo

* Send setinfo after auth

* Add pipline

* fix golangci

* revert fixing typo

* support sentinel
2024-02-20 17:34:35 +02:00
ofekshenawa 35de49a8da
Speed up connections by sending SetInfo via a pipeline (#2880)
* Send Client SetInfo via pipe

* Fix ACL test

* Add client set info to acl command rules
2024-02-15 12:48:56 +02:00
ofekshenawa 8afc2b9314
Remove freq object test from RE tests (#2904) 2024-02-14 23:28:28 +02:00
fengyun.rui d383038a0f
feat: add object fraq command (#2844)
* feat: add object fraq command

Signed-off-by: rfyiamcool <rfyiamcool@163.com>

* feat: add object fraq command

Signed-off-by: rfyiamcool <rfyiamcool@163.com>

---------

Signed-off-by: rfyiamcool <rfyiamcool@163.com>
Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
2024-02-14 23:05:05 +02:00
Tiago Peczenyj 21ed15bbed
Add helpers to set libinfo without panic (#2724)
* add helpers to set library name and library info without risk of panic if we try to set both

* refactor code to use helpers

* add example

* refactor tests

* fix testable example

* simplify example

* rename exampl

* fix ring.go

* update example

---------

Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
2024-02-14 22:40:20 +02:00
ofekshenawa 27581fcb43
Change Z Member type to interface (#2861) 2024-01-07 11:57:20 +02:00
ofekshenawa a32be3d93d
Add Suffix support to default client set info (#2852)
* Add Suffix support to defualt client set info

* Change ClientNameSuffix to IdentitySuffix

* add tests
2024-01-04 14:40:14 +02:00
ofekshenawa b762309243
Add RE tests (#2847)
* Add RE tests

* Enable testing on RE

* change db id to 0 - only when RE cluster is set

* label tests

* adding secrets
2024-01-01 22:19:22 +02:00
ofekshenawa e535124055
Change Z member to string (#2818) 2023-12-17 15:20:01 +02:00
ofekshenawa 1d784578df
Add BITFIELD_RO Command (#2820)
Co-authored-by: Chayim <chayim@users.noreply.github.com>
2023-12-17 15:19:27 +02:00
Nic Gibson 343016bf72
add InfoMap command (#2665)
Add an extended version of Info() to parse the results from a call to redis.Info so that it’s simpler to operate on any given item in the result.

Signed-off-by: Nic Gibson <nic.gibson@redis.com>
2023-10-30 18:07:42 +02:00
Nikan Vasei 0637c53f10
Added the support for WAITAOF which is a new command in redis ver7.2.0 (#2629)
* implemented WaitAOF command for the redis ver7.2.0

* updated the test corresponding to WaitAOF

---------

Co-authored-by: Chayim <chayim@users.noreply.github.com>
Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
2023-09-20 14:09:23 +03:00
Tiago Peczenyj e8ad794e96
Format code and fix go vet (#2696)
* run go fix ./...

Signed-off-by: Tiago Peczenyj <tpeczenyj@weborama.com>

* run make fmt

Signed-off-by: Tiago Peczenyj <tpeczenyj@weborama.com>

* fix go vet ./... issues

* Update README.md

Reorder imports with the rules defined in the Makefile 

as if we run `make fmt`

* run gofumpt -w .

* update Makefile to use gofumpt instead gofmt

* increment makefile

* format test

* format tests

Signed-off-by: Tiago Peczenyj <tpeczenyj@weborama.com>

---------

Signed-off-by: Tiago Peczenyj <tpeczenyj@weborama.com>
Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
2023-09-20 14:03:44 +03:00
loveY 1a7d2f4ad4
upgrade bitfield cmd to `add multiple values` (#2648)
Co-authored-by: wangzheng1 <wangzheng1@yidian-inc.com>
Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
2023-09-20 10:49:46 +03:00
ofekshenawa 0b6be62b71
Identify client on connect (#2708)
* Update CLIENT-SETINFO to support suffixes

* Update CLIENT-SETINFO

* fix acl log test

* add setinfo option to cluster

* change to DisableIndentity

* change to DisableIndentity
2023-09-20 10:33:09 +03:00
Anurag Bandyopadhyay 3b0d10b4ed
Support for CLIENT SETINFO (#2659)
* feat: merge master

* feat: revert ring.go

* feat: add ClientSetInfo command

* fix: test and cmd:

* fix: test and cmd

* fix: test and cmd

* fix: test and cmd

* feat: redesigning the API

* fix: panic test

* fix: panic test

---------

Co-authored-by: Anuragkillswitch <70265851+Anuragkillswitch@users.noreply.github.com>
Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
2023-09-14 16:24:23 +03:00
guangwu c0ab7815ea
chore: fix staticcheck (#2631) 2023-07-02 14:38:52 +03:00
Monkey 6f0af685cf
fix the reading of the "entries-read" field in XInfoStreamFull (#2595)
* fix:  In the response of the XInfoStreamFull command, the "entries-read" field may be nil

Signed-off-by: monkey92t <golang@88.com>

* add XInfoStreamFull test

Signed-off-by: monkey92t <golang@88.com>

* add test XInfoStreamFull entries_read = nil

Signed-off-by: monkey92t <golang@88.com>

---------

Signed-off-by: monkey92t <golang@88.com>
2023-05-29 08:40:45 +03:00
Anurag Bandyopadhyay 31ba855dde
feat: Add ACL LOG (#2536)
* feat: Add ACL LOG

Signed-off-by: monkey92t <golang@88.com>

---------

Signed-off-by: monkey92t <golang@88.com>
Co-authored-by: Anuragkillswitch <70265851+Anuragkillswitch@users.noreply.github.com>
Co-authored-by: ktsivkov <ktsivkov@gmail.com>
Co-authored-by: Elena Kolevska <elena@kolevska.com>
Co-authored-by: monkey92t <golang@88.com>
2023-05-08 22:40:42 +08:00
Monkey b8c7317cc6
feat: add client info command (#2483)
* feat: add client info command

Signed-off-by: monkey92t <golang@88.com>

* add lib-name, lib-ver

Signed-off-by: monkey92t <golang@88.com>

---------

Signed-off-by: monkey92t <golang@88.com>
2023-04-24 21:18:33 +08:00
Anurag Bandyopadhyay 6ecbcf6c90
Add ZRANK, ZREVRANK WITHSCORE (#2531)
* feat: adding zrankwithscore and zrevrankwithscore commands : redis 7.2

* fix: test for non-existing members

* fix: Error check

* fix: string to float

* add ZRankWithScore API for Cmdable interface

Signed-off-by: monkey92t <golang@88.com>

* add notes

Signed-off-by: monkey92t <golang@88.com>

---------

Signed-off-by: monkey92t <golang@88.com>
Co-authored-by: Anuragkillswitch <70265851+Anuragkillswitch@users.noreply.github.com>
Co-authored-by: monkey92t <golang@88.com>
2023-04-19 22:37:41 +08:00
Kristian Tsivkov 38ca7c1680
Add support for MODULE LOADEX command (#2490)
* Added support for MODULE LOADEX command

Co-authored-by: Anurag Bandyopadhyay <angbpy@gmail.com>
2023-04-18 21:03:47 +08:00
Monkey 6edb1529ff
test: redis-version to 7.2-rc1 (#2532)
* test: redis-version to 7.2-rc1

Signed-off-by: monkey92t <golang@88.com>
2023-04-12 20:17:10 +08:00
Monkey 37c057b8e5
feat: read the structure to increase the judgment of the omitempty op… (#2529)
* feat: read the structure to increase the judgment of the omitempty option, the same as json

Signed-off-by: monkey92t <golang@88.com>
2023-04-03 15:43:18 +08:00
Elena Kolevska e96c7b5f58
Function stats, function kill, fcall and fcall_ro (#2486) 2023-03-30 21:52:06 +08:00
Akshay Gandhi 386e0f0cd3
Add support for acl dryrun command (#2502)
* add support for acl dryrun command

Co-authored-by: Monkey <golang@88.com>
2023-03-26 22:21:46 +08:00
Anurag Bandyopadhyay 984bc2810d
Add support for COMMAND GETKEYS & COMMAND GETKEYSANDFLAGS (#2500)
* feat: Adding support for CommandsGetKeysAndFlags & CommandGetKeys

Co-authored-by: Anuragkillswitch <70265851+Anuragkillswitch@users.noreply.github.com>
2023-03-25 18:57:12 +08:00
Anurag Bandyopadhyay 6790337e5d
Add support for LCS Command (#2480)
* feat: initial set up for LCSCmd

* feat: adding test for LCS with no additional params

* feat: adding test for LCS with LEN param

* feat: resolving conflicts in command.go

* fix: changing reply and query structure

* feat: commands test for lcs and lcs with len

* fix: using dynamic args length

* fix: read

* fix: Cmd init

* sorting out the LCS commands

Signed-off-by: monkey92t <golang@88.com>

* fix: Adding error case test

* fix: adding correct error message

* fix: removed blank lines

---------

Signed-off-by: monkey92t <golang@88.com>
Co-authored-by: Anuragkillswitch <70265851+Anuragkillswitch@users.noreply.github.com>
Co-authored-by: monkey92t <golang@88.com>
2023-03-24 15:38:11 +08:00
Monkey 540554043b
feat(cmd): support for adding byte,bit parameters to the bitpos command (#2498)
Signed-off-by: monkey92t <golang@88.com>
2023-03-23 00:05:50 +08:00
Anurag Bandyopadhyay 049d4f9691
Add: Support for COMMAND LIST command (#2491)
* feat: add support and tests for Command list command

Co-authored-by: Anuragkillswitch <70265851+Anuragkillswitch@users.noreply.github.com>
2023-03-19 18:20:42 +08:00
Elena Kolevska 6501a8b15e
Implement `FUNCTION` group of commands (#2475)
* Implements function load, load replace and flush

* Implements `FUNCTIONS LIST`

* Fixes ineffectual assignment to err

* Extends other tests from the `FUNCTION` group

* Changes RdsFunction to Function

* Renames FunctionList command, for consistency

* Small fixes after review

* More fixes after review

* Implements the `LIBRARYNAME` and `WITHCODE` args for `FUNCTION LIST`

* Implements `FUNCTION DUMP`. Solves https://github.com/redis/go-redis/issues/2396

* Use a pointer instead of value for `First()`

* Implements `FUNCTION RESTORE`. Closes #2401.

* chore: tidy code

Signed-off-by: monkey92t <golang@88.com>

---------

Signed-off-by: monkey92t <golang@88.com>
Co-authored-by: monkey92t <golang@88.com>
2023-03-09 23:01:37 +08:00
Jens Fosgerau 9664fd2359
feat(zadd): add ZAddLT and ZAddGT (#2429)
Co-authored-by: Vladimir Mihailenco <vladimir.webdev@gmail.com>
2023-03-04 09:03:14 +02:00
YuGan 6045d2e456
Add support for BZMPOP (#2456)
* Add support for BZMPOP

* Add BZMPOP command comment
2023-02-23 19:25:41 +08:00
Anurag Bandyopadhyay 621c02c583
Adding support for ZMPOP command (#2408)
* feat: add ZMPOP command

* fix: reply reading string

* fix: evaluating a test tweak

* fix: test fix

* fix: reverting to debug

* fix: test fix

* fix: remove old implementation

* feat: adding ZMPOP and tests

* feat: modifying ZMpopCmd

* fix: fix test

* fix: test removal check

* fix: fix testS

* Adding more tests

* fix: using redis.Nil instead of string

* fix: renaming command to ZArrayWithKeyCmd to match the standard

* feat: updated ZArrayWithKeyCmd to ZSliceWithKeyCmd

* feat: adding help strings

---------

Co-authored-by: Anuragkillswitch <70265851+Anuragkillswitch@users.noreply.github.com>
Co-authored-by: Chayim <chayim@users.noreply.github.com>
2023-02-23 01:38:51 +08:00
ZhiQiang Li bd0d1c2293
Add support for BLMPOP (#2442)
* Add support for BLMPOP
2023-02-14 23:50:51 +08:00
Monkey d2c53bd2a5
refactor: change ListElementCmd to KeyValuesCmd. (#2443)
* refactor: change ListElementCmd to KeyValuesCmd

Signed-off-by: monkey92t <golang@88.com>

* KeyValuesCmd.val are modified to pointers

Signed-off-by: monkey92t <golang@88.com>

* recover KeyValuesCmd API

Signed-off-by: monkey92t <golang@88.com>

---------

Signed-off-by: monkey92t <golang@88.com>
2023-02-14 21:52:56 +08:00
Anurag Bandyopadhyay 0d306237c7
Add support for LMPOP (#2440)
* feat: add lmpop command
2023-02-13 23:02:14 +08:00
Monkey 8db6eeed27
feat(scan): scan time.Time sets the default decoding (#2413)
* feat(scan): scan time.Time uses `UnmarshalText(RFC3339)` interface decoding by default
2023-02-07 20:23:39 +08:00
Elena Kolevska 9d5e48507e
Expiretime and PExpireTime (#2426)
* Implemented EXPIRETIME and PEXPIRETIME
2023-02-07 18:41:27 +08:00
Dimitrij Denissenko 7fa451c740 chore: fewer test dependencies 2023-01-27 15:01:50 +00:00
Vladimir Mihailenco 97b491aace chore: update import path 2023-01-23 08:48:54 +02:00
monkey92t 701b1d0a8b fix: 386 platform test
Signed-off-by: monkey92t <golang@88.com>
2023-01-19 16:01:25 +08:00
monkey92t 0064199323 feat: appendArgs adds to read the structure field and supplements the test
Signed-off-by: monkey92t <golang@88.com>
2023-01-19 15:31:31 +08:00
Emilien Kofman ca063fd0ad feat: add SORT_RO command 2023-01-18 12:24:09 +01:00