Commit Graph

321 Commits

Author SHA1 Message Date
ofekshenawa 7b4f30c599 Add client tracking and client trackinginfo commands 2024-01-15 22:45:49 +02:00
ofekshenawa 277e8b7d9f
Support Monitor Command (#2830)
* Add monitor command

* Add monitor commadn and tests

* insure goroutine shutdown

* fix data race

* linting

* change timeout explanation

---------

Co-authored-by: Chayim <chayim@users.noreply.github.com>
2023-12-17 12:35:10 +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
Seth Rylan Gainey d6a3f02666
Add BitMapCmdable to Cmdable. (#2737)
Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
2023-10-30 14:32:13 +02:00
ofekshenawa 0d7a013e5d
Json support (#2769)
* Add support for RedisJSON

* Add optional args and tests

* Add more tests

* Add more tests

* Add more tests and cleanups

* Add docstring

* update JSONArrIndex and matching texts

Rename JSONArrIndexWithArgs to JSONArrIndexArgs
change name of args struct to match function name for consistency
change arg types to int (for required arg) and *int (for optional)

* update JSONArrTrim and matching texts

Rename JSONArrTrimWithArgs to JSONArrTrimArgs
change name of args struct to match function name for consistency
change arg types to int (for required arg) and *int (for optional)

* update JSONGetWithArgs and matching texts

Rename JSONGetWithArgs to JSONGetArgs
Removed Paths & Path from args - redundant and ambiguous
Renamed mispelled "Indention"
Changed args param from pointer to value
Updated and added additional tests for formatting params

* Update JSONSetMode

changed mode parameter back to string, added value checking for that
string

* Updated JSONMSet

Changed name of param struct to ...Args  for consistency
Updated arg list to use an array of structs not pointers as
all args are mandatory (we never want to pass a nil parameter)

* Updated tests for JSONMSet

* Added stubbed (panicking) implementations of JSON.RESP AND JSON.DEBUG

* Pre-pull request tidy up

Renamed xArgs() to xWithArgs to match other Redis modules

Modified params to xWithArgs functions to use a pointer for the
arguments struct to match other Redis modules.

Modified JSONMSet to JSONMSetArgs and added a version that takes
a vararray of args to match the semantics of the native redis call

Updated tests to match above changes.

Renamed some variables in the json tests for consistency

* Testing fixes

Fixed error in JSONSetWithArgs found during tests
Fixed tests for indentation

* fix JSONCmdable typo (#5)

* Remove deprecated command: JSONNumMultBy (#6)

* Lowercase newJSONCmd (#7)

---------

Co-authored-by: Nic Gibson <nic.gibson@redis.com>
Co-authored-by: Nic Gibson <newt+github@noslogan.org>
2023-10-30 14:09:25 +02:00
Gabriel c6fe509f4a
Add stream interface back to `Cmdable` (#2725)
Without it we can't call stream functions from `Cmdable` and alikes.

Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
2023-09-27 10:50:47 +03:00
Chayim 6199a2af2c
Making command structs digestable (#2716)
* intial move

* adding stringcmdable

* moving module commands to align with other changes

---------

Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
Co-authored-by: ofekshenawa <ofek.shenawa@redis.com>
2023-09-20 16:08:24 +03:00
Tiago Peczenyj 934c6a3fe0
make public probabilistic and redis gears interfaces (#2695)
Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
2023-09-20 14:54:50 +03: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
ofekshenawa 017466b6cc
Add Redis Timeseries support (#2688)
* Add Redis Timeseries support

* Small fixes

* Make timeseries interface public

* remove bloom renaming
2023-09-11 14:51:31 +03:00
ofekshenawa aba21be8cd
Add Redis Gears support (#2675)
* Add gears commands and tests

* Fix tfunctionlist and add docstrings

* fixes

* fixes

* add tfcallasync to gearsCmdable
2023-08-16 17:06:07 +03:00
ofekshenawa 558581eac6
bloom support (#2673) 2023-08-15 10:19:19 +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
Anurag Bandyopadhyay d7c6c3598b
Maintenance : Deprecate FCallRo & add FCallRO (#2550)
* Deprecated FCallRo

* feat: FCallRo to FCallRO

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

* update doc

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-18 01:18:06 +08:00
Anurag Bandyopadhyay 0d860cb038
Add support for CLUSTER MYSHARDID command (#2530)
* feat: add support for CLUSTER MYSHARDID command

Co-authored-by: Anuragkillswitch <70265851+Anuragkillswitch@users.noreply.github.com>
2023-04-17 21:52:35 +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
Anurag Bandyopadhyay 9aba95a74f
feat: Add support for CLUSTER SHARDS command (#2507)
* feat: Adding support for CLUSTER SHARDS command

Co-authored-by: Anuragkillswitch <70265851+Anuragkillswitch@users.noreply.github.com>
2023-03-29 21:44:06 +08:00
Monkey 2cdd5ea34a
fix: eval api cmd.SetFirstKeyPos (#2501)
Signed-off-by: monkey92t <golang@88.com>
2023-03-28 21:24:04 +08:00
Monkey 4c72b4e097
docs: add instructions for the HSet api (#2503)
Signed-off-by: monkey92t <golang@88.com>
Co-authored-by: Chayim <chayim@users.noreply.github.com>
2023-03-28 20:12:32 +08:00
Anurag Bandyopadhyay 42d730c143
Add support for CLUSTER LINKS command (#2504)
* feat: Adding support for Cluster Links Command

Co-authored-by: Anuragkillswitch <70265851+Anuragkillswitch@users.noreply.github.com>
2023-03-28 12:19:54 +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 38aa0b7792
fix(appendArg): appendArg case special type (#2489)
Signed-off-by: monkey92t <golang@88.com>
2023-03-23 00:30:20 +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
Elena Kolevska 9d5e48507e
Expiretime and PExpireTime (#2426)
* Implemented EXPIRETIME and PEXPIRETIME
2023-02-07 18:41:27 +08:00
Vladimir Mihailenco 97b491aace chore: update import path 2023-01-23 08:48:54 +02: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
monkey92t 684f34d441 Merge branch 'master' into struct-to-hashset 2023-01-19 15:04:25 +08:00
정보교 913936b4cd fix: change serialize key "key" to "redis" 2023-01-19 13:00:04 +09:00
Emilien Kofman ca063fd0ad feat: add SORT_RO command 2023-01-18 12:24:09 +01:00
monkey92t bb65dcdf09 feat: add zintercard cmd
Signed-off-by: monkey92t <golang@88.com>
2023-01-07 23:05:04 +08:00
boatrainlsz bc51c61a45 feat: add support for SINTERCARD command 2022-11-21 22:11:23 +08:00
Vladimir Mihailenco 1de0d2a1b7 chore: remove outdated comment 2022-10-09 13:11:02 +03:00