224 Commits
Author SHA1 Message Date
zeekay 6994cf05aa kv, not redis: rename the package, the extras and the URL scheme
We do not use Redis. The client was a go-redis fork and still said so
everywhere: `package redis`, `redis.NewClient`, `redis://`, `extra/redisotel`.
Consumers wrote `redis.Client` against a Valkey-backed store called KV.

  package redis            -> package kv          (93 decls)
  redis.X                  -> kv.X                (2,794 call sites)
  "redis: …" errors        -> "kv: …"             (206)
  extra/redis{otel,cmd,prometheus,census} -> extra/kv{otel,cmd,prometheus,census}
  redis:// , rediss://     -> kv:// , kvs://      (ParseURL)
  Redis*/‌*Redis* idents    -> KV*/*KV*
  REDIS_VERSION, REDIS_ENDPOINTS_CONFIG_PATH -> KV_*

I previously argued this rename was unsafe because much of it was "wire
contract". That was wrong, and the categorisation shows why: RESP command names
are GET/SET/HSET — they never contain the word. Of 5,771 occurrences only two
kinds were server-visible at all: the ParseURL scheme (we choose what we pass;
our configs already use kv://) and the CLIENT SETINFO lib-name label, which the
server merely records. Nothing here changes a byte of protocol.

Two things deliberately keep the old spelling:
  RediSearch  — names a specific external module the FT.* commands map to.
  StoreDist   — contains the letters by accident (sto-reDis-t), not the word.

Breaking for consumers by design: every import site must move redis.X -> kv.X.
Minor bump, never a major — this module stays v9 forever.
2026-07-26 08:34:19 -07:00
zeekay 2016e30150 module path: github.com/hanzoai/kv-go -> github.com/hanzokv/go
KV lives in its own org now, like hanzokms / hanzos3 / hanzo-ds. The repo moved
hanzoai/kv-go -> hanzokv/go, so the module path follows: a Go module path must
match where the repo actually is, or the proxy cannot resolve it.

The name is `go`, not `kv-go`, following the hanzo-ds convention — that org
holds go, mock, native, sqlbuilder, sqlparser, each named for its language or
concern with the ORG supplying the product noun. Repeating "kv" inside a repo
that already lives under hanzokv is the compound-word habit we are dropping.

349 occurrences across 188 files: the root module, all four extra/* modules,
every example module, imports throughout the tree, and the docs. Builds clean.

The package is still `package redis` and the extra dirs are still named
redis*. That rename is deliberately NOT bundled here: it is 5,771 occurrences,
it breaks all 11 consumers at once, and a large share are WIRE CONTRACTS rather
than branding — the redis:// scheme parser, the "redis: nil" error string, RESP
command names. Renaming those breaks protocol compatibility with the Valkey
server. It needs the same our-vocabulary-vs-the-wire split the argo sweep used,
as its own change.

GitHub keeps the old path redirecting, and versions already published under
github.com/hanzoai/kv-go/v9 stay resolvable, so nothing breaks the moment this
lands. Consumers move on their own schedule.
2026-07-25 23:43:06 -07:00
zeekay 24f201b8e5 Rebrand as hanzoai/kv-go
Update module path from github.com/redis/go-redis/v9 to
github.com/hanzoai/kv-go/v9 for use as the Hanzo KV Go SDK.

- Update go.mod module declaration
- Update all Go imports across 260 files
- Update all submodule go.mod files (extra/*, example/*, internal/customvet)
2026-01-19 18:15:43 -08:00
cxljsandGitHub 254e65fb47 refactor(math): use Go1.21's built-in min/max function (#3656)
Signed-off-by: Xiaolong Chen <[email protected]>
2026-01-08 17:46:13 +02:00
f711eb0f62 feat(cluster): Implement Request and Response Policy Based Routing in Cluster Mode (#3422)
* Add search module builders and tests (#1)

* Add search module builders and tests

* Add tests

* Use builders and Actions in more clean way

* Update search_builders.go

Co-authored-by: Nedyalko Dyakov <[email protected]>

* Update search_builders.go

Co-authored-by: Nedyalko Dyakov <[email protected]>

* Apply suggestions from code review

Co-authored-by: Nedyalko Dyakov <[email protected]>

* feat(routing): add internal request/response policy enums

* feat: load the policy table in cluster client (#4)

* feat: load the policy table in cluster client

* Remove comments

* modify Tips and command pplicy in commandInfo (#5)

* centralize cluster command routing in osscluster_router.go and refactor osscluster.go (#6)

* centralize cluster command routing in osscluster_router.go and refactor osscluster.go

* enalbe ci on all branches

* Add debug prints

* Add debug prints

* FIX: deal with nil policy

* FIX: fixing clusterClient process

* chore(osscluster): simplify switch case

* wip(command): ai generated clone method for commands

* feat: implement response aggregator for Redis cluster commands

* feat: implement response aggregator for Redis cluster commands

* fix: solve concurrency errors

* fix: solve concurrency errors

* return MaxRedirects settings

* remove locks from getCommandPolicy

* Handle MOVED errors more robustly, remove cluster reloading at exectutions, ennsure better routing

* Fix: supports Process hook test

* Fix: remove response aggregation for single shard commands

* Add more preformant type conversion for Cmd type

* Add router logic into processPipeline

---------

Co-authored-by: Nedyalko Dyakov <[email protected]>

* remove thread debugging code

* remove thread debugging code && reject commands with policy that cannot be used in pipeline

* refactor processPipline and cmdType enum

* remove FDescribe from cluster tests

* Add tests

* fix aggregation test

* fix mget test

* fix mget test

* remove aggregateKeyedResponses

* added scaffolding for the req-resp manager

* added default policies for the search commands

* split command map into module->command

* cleanup, added logic to refresh the cache

* added reactive cache refresh

* revert cluster refresh

* fixed lint

* addresed first batch of comments

* rewrote aggregator implementations with atomic for native or nearnative primitives

* addressed more comments, fixed lint

* added batch aggregator operations

* fixed lint

* updated batch aggregator, fixed extractcommandvalue

* fixed lint

* added batching to aggregateResponses

* fixed deadlocks

* changed aggregator logic, added error params

* added preemptive return to the aggregators

* more work on the aggregators

* updated and and or aggregators

* fixed lint

* added configurable policy resolvers

* slight refactor

* removed the interface, slight refactor

* change func signature from cmdName to cmder

* added nil safety assertions

* few small refactors

* added read only policies

* removed leftover prints

* Rebased to master, resolved comnflicts

* fixed lint

* updated gha

* fixed tests, minor consistency refactor

* preallocated simple errors

* changed numeric aggregators to use float64

* speculative test fix

* Update command.go

Co-authored-by: Nedyalko Dyakov <[email protected]>

* Update main_test.go

Co-authored-by: Nedyalko Dyakov <[email protected]>

* Add static shard picker

* Fix nil value handling in command aggregation

* Modify the Clone method to return a shallow copy

* Add clone method to digest command

* Optimize keyless command routing to respect ShardPicker policy

* Remove MGET references

* Fix MGET aggregation to map individual values to keys across shards

* Add clone method to hybrid search commands

* Undo changes in route keyless test

* remove comments

* Add test for DisableRoutingPolicies option

* Add Routing Policies Comprehensive Test Suite and Fix multi keyed aggregation for different step

---------

Co-authored-by: Nedyalko Dyakov <[email protected]>
Co-authored-by: Nedyalko Dyakov <[email protected]>
Co-authored-by: Hristo Temelski <[email protected]>
2025-11-28 11:46:23 +02:00
Marco FerrerandGitHub b362eb7f7d fix(txpipeline) add wait to keyless commands list (#3615) 2025-11-25 14:15:13 +02:00
Nedyalko DyakovandGitHub 5069fd6fa9 feat(cmd): Add CAS/CAD commands (#3583)
* add cas/cad commands

* feat(command): Add SetIFDEQ, SetIFDNE and *Get cmds

Decided to move the *Get argument as a separate methods, since the
response will be always the previous value, but in the case where
the previous value is `OK` there result may be ambiguous.

* fix tests

* matchValue to be interface{}

* Only Args approach for DelEx

* use uint64 for digest, add example

* test only for 8.4
2025-11-07 13:31:00 +02:00
destinyooooandGitHub 63fbaafcef feat: support for latency command (#3584)
* support for latency command

* add NonRedisEnterprise label for latency test
2025-11-05 21:10:35 +02:00
71bb3cae4f Add support for XReadGroup CLAIM argument (#3578)
* Add support for XReadGroup CLAIM argument

* modify tutorial tests

---------

Co-authored-by: Nedyalko Dyakov <[email protected]>
2025-11-03 18:58:14 +02:00
d924f7ea68 feat(bitop): add support for the new bitop operations (#3409)
* Add support for new bitop operations

* chore(ci): Add 8.2 pre build for CI

* feat(info): add new client info keys

* fixed tests

* added godocs for bitop commands

---------

Co-authored-by: Nedyalko Dyakov <[email protected]>
Co-authored-by: Nedyalko Dyakov <[email protected]>
2025-07-02 17:19:24 +03:00
Nedyalko DyakovandGitHub 05f42e2327 fix(txpipeline): keyless commands should take the slot of the keyed (#3411)
* fix(txpipeline): keyless commands should take the slot of the keyed commands

* fix(txpipeline): extract only keyed cmds from all cmds

* chore(test): Add tests for keyless cmds and txpipeline

* fix(cmdSlot): Add preferred random slot

* fix(cmdSlot): Add shortlist of keyless cmds

* chore(test): Fix ring test

* fix(keylessCommands): Add list of keyless commands

Add list of keyless Commands based on the Commands output
for redis 8

* chore(txPipeline): refactor slottedCommands impl

* fix(osscluster): typo
2025-06-24 10:34:23 +03:00
fukua95andGitHub 858ecda7fd fix: insert entry during iterating over a map (#3398)
Signed-off-by: fukua95 <[email protected]>
2025-06-09 11:03:18 +03:00
4e22885ca1 feat: support vectorset (#3375)
* feat: support vectorset

* fix: char encoding error

* use `any` instread of `interface{}`

* update vectorset API

Signed-off-by: fukua95 <[email protected]>

* refact: MapStringFloat64Cmd -> VectorInfoSliceCmd

Signed-off-by: fukua95 <[email protected]>

* update:

* the type of vector attribute: string -> VectorAttributeMarshaller
* Add a new API VRemAttr
* mark the APIs are experimental

Signed-off-by: fukua95 <[email protected]>

* trigger CI again

Signed-off-by: fukua95 <[email protected]>

* rename a API: VRemAttr -> VClearAttributes

Signed-off-by: fukua95 <[email protected]>

* add test

Signed-off-by: fukua95 <[email protected]>

* feat(vectorset): improve VSetAttr API and add comprehensive test suite

- Simplify VSetAttr to accept interface{} with automatic JSON marshalling
- Remove VectorAttributeMarshaller interface for simpler API
- Add comprehensive unit tests for all vectorset commands

---------

Signed-off-by: fukua95 <[email protected]>
Co-authored-by: Nedyalko Dyakov <[email protected]>
2025-06-05 11:35:45 +03:00
ofekshenawaandGitHub b67455e099 xinfo-groups: support nil lag in XINFO GROUPS (#3369)
* xinfo-groups: support nil lag in XINFO GROUPS

* Add test

* docs: clarify XInfoGroup.Lag field behavior with Nil values

* docs: clarify XInfoGroup.Lag field behavior
2025-05-21 13:57:58 +03:00
ofekshenawaandGitHub 2f0a9b720a migrate golangci-lint config to v2 format (#3354)
* migrate golangci-lint config to v2 format

* chore: skip CI on migration [skip ci]

* Bump golangci version

* Address several golangci-lint/staticcheck warnings

* change staticchecks settings
2025-04-29 12:53:06 +03:00
GlennandGitHub a7b4ce5e50 docs: fix documentation comments (#3351) 2025-04-22 08:11:00 +03:00
f3c2711fe1 move regexp.MustCompile close to call (#3280)
* move regexp.MustCompile out of func

* move moduleRe close to call

---------

Co-authored-by: Nedyalko Dyakov <[email protected]>
2025-02-20 16:22:34 +02:00
Nedyalko DyakovandGitHub a39be37273 feat(tests): validate that ConfigSet and ConfigGet work with Modules (#3258)
* Add tests for unified config in Redis 8

* WIP: fix reading FT.CONFIG with RESP3

* add more tests

* use search-timeout

* move deprecated warnings on the bottom
2025-02-03 19:10:54 +02:00
Nedyalko DyakovandGitHub 94b88f5ab2 fix(command): add missing io-thread key in client info (#3244)
* Add 8.0m3 image in docker compose

* Add new key `io-thread` in client info

Redis 8.0 introduces new key `io-thread` in the response
for client info. The key needs to be parsed. If an unknown key
is observed, the client will return an error.

* improve readibility

* Revert "Add 8.0m3 image in docker compose"

This reverts commit 787c41f42917fb7d3ca3471d9941304695a9b3c8.

* add dockers directory to gitignore
2025-01-23 14:47:28 +02:00
fc32d0a01d Recognize byte slice for key argument in cluster client hash slot computation (#3049)
Co-authored-by: Vladyslav Vildanov <[email protected]>
Co-authored-by: ofekshenawa <[email protected]>
2024-11-21 14:38:11 +02:00
ofekshenawaandGitHub d1b4eaed41 Support TimeSeries commands with RESP 2 protocol (#3184)
* Support Timeseries resp 2

* Change to resp 2

* Support Resp2 for TimeSeries commands
2024-11-13 10:27:00 +02:00
04005cbdc7 Support Resp 3 Redis Search Unstable Mode (#3098)
* Updated module version that points to retracted package version (#3074)

* Updated module version that points to retracted package version

* Updated testing image to latest

* support raw parsing for problematic Redis Search types

* Add UnstableResp3SearchModule to client options

* Add tests for Resp3 Search unstable mode

* Add tests for Resp3 Search unstable mode

* Add readme note

* Add words to spellcheck

* Add UnstableResp3SearchModule check to assertStableCommand

* Fix assertStableCommand logic

* remove go.mod changes

* Check panic occur on tests

* rename method

* update errors

* Rename flag to UnstableResp3

---------

Co-authored-by: Vladyslav Vildanov <[email protected]>
Co-authored-by: vladvildanov <[email protected]>
2024-09-12 11:26:10 +03:00
244a3e22da RediSearch Support (#2801)
* Add RediSearch Support

* searach

* Add RediSearch commands and tests

* Adding more tests and fixing commands

* Remove unnecessary additions

* fixing tests

* fixing tests

* fixing tests

* fixing FTConfig dialect test

* fix commects

* make enum for field types

* Support resp 2

* fix golang ci

* fix ftinfo

---------

Co-authored-by: Chayim <[email protected]>
2024-06-26 13:13:06 +03:00
2d7382e8cc Add (*StatusCmd).Bytes() method (#3030)
Signed-off-by: Andrew Haines <[email protected]>
Co-authored-by: Monkey <[email protected]>
2024-06-21 11:00:16 +08:00
ofekshenawaandGitHub 2a3de7e1fc Change redis version from 7.2 to 7.4 in makefile (#3034)
* Change redis version from 7.2 to 7.4

* fix jsonGet test

* Add 'watch' to client info

* Remove jsonGet from Enterprise tests
2024-06-20 00:08:35 +03:00
ofekshenawaandGitHub 34dacf14a7 Fix monitor on go 1.19 (#2908)
* Fix monitor on go 1.19

* Remove exmaple tests when go 1.19

* Fix typo

* Fix typo

* Skip exmaple test

* Skip exmaple test

* Guard Peek call with mutex for thread safety
2024-03-21 10:48:31 +02:00
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 <[email protected]>
2024-02-14 22:40:20 +02:00
dragon-flyandGitHub d8e3e95866 return raw value instead of funcation calling in Result() (#2831)
Signed-off-by: lowang-bh <[email protected]>
2024-01-03 10:43:42 +02:00
c828764336 Allow scanning redis values into pointer fields (#2787)
* Allow scanning redis values into pointer fields

* Formatting

---------

Co-authored-by: Ilia Personal <[email protected]>
Co-authored-by: ofekshenawa <[email protected]>
2023-12-17 17:42:45 +02:00
86c68be278 Execute "COMMAND" command only when readonly (#2815)
* remove command command from oss cluster

* remove command command from oss cluster

* remove cmdInfo from ring

---------

Co-authored-by: Chayim <[email protected]>
2023-12-17 15:21:01 +02:00
8c695488a2 fix: add Cmder annotation (#2816)
* fix: add Cmder annotation

Signed-off-by: rfyiamcool <[email protected]>

* fix: add Cmder annotation

Signed-off-by: rfyiamcool <[email protected]>

---------

Signed-off-by: rfyiamcool <[email protected]>
Co-authored-by: ofekshenawa <[email protected]>
2023-12-17 15:20:23 +02:00
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 <[email protected]>
2023-12-17 12:35:10 +02:00
Nic GibsonandGitHub 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 <[email protected]>
2023-10-30 18:07:42 +02:00
e8ad794e96 Format code and fix go vet (#2696)
* run go fix ./...

Signed-off-by: Tiago Peczenyj <[email protected]>

* run make fmt

Signed-off-by: Tiago Peczenyj <[email protected]>

* 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 <[email protected]>

---------

Signed-off-by: Tiago Peczenyj <[email protected]>
Co-authored-by: ofekshenawa <[email protected]>
2023-09-20 14:03:44 +03:00
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 <[email protected]>
Co-authored-by: ofekshenawa <[email protected]>
2023-09-14 16:24:23 +03:00
ofekshenawaandGitHub 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
ofekshenawaandGitHub 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
Kamyab ZarehandGitHub b1800df239 fix: Fix bool ToBool bug (#2626) 2023-06-13 12:20:21 +03:00
MonkeyandGitHub 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 <[email protected]>

* add XInfoStreamFull test

Signed-off-by: monkey92t <[email protected]>

* add test XInfoStreamFull entries_read = nil

Signed-off-by: monkey92t <[email protected]>

---------

Signed-off-by: monkey92t <[email protected]>
2023-05-29 08:40:45 +03:00
31ba855dde feat: Add ACL LOG (#2536)
* feat: Add ACL LOG

Signed-off-by: monkey92t <[email protected]>

---------

Signed-off-by: monkey92t <[email protected]>
Co-authored-by: Anuragkillswitch <[email protected]>
Co-authored-by: ktsivkov <[email protected]>
Co-authored-by: Elena Kolevska <[email protected]>
Co-authored-by: monkey92t <[email protected]>
2023-05-08 22:40:42 +08:00
MonkeyandGitHub b8c7317cc6 feat: add client info command (#2483)
* feat: add client info command

Signed-off-by: monkey92t <[email protected]>

* add lib-name, lib-ver

Signed-off-by: monkey92t <[email protected]>

---------

Signed-off-by: monkey92t <[email protected]>
2023-04-24 21:18:33 +08:00
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 <[email protected]>

* add notes

Signed-off-by: monkey92t <[email protected]>

---------

Signed-off-by: monkey92t <[email protected]>
Co-authored-by: Anuragkillswitch <[email protected]>
Co-authored-by: monkey92t <[email protected]>
2023-04-19 22:37:41 +08:00
MonkeyandGitHub 6edb1529ff test: redis-version to 7.2-rc1 (#2532)
* test: redis-version to 7.2-rc1

Signed-off-by: monkey92t <[email protected]>
2023-04-12 20:17:10 +08:00
Elena KolevskaandGitHub e96c7b5f58 Function stats, function kill, fcall and fcall_ro (#2486) 2023-03-30 21:52:06 +08:00
9aba95a74f feat: Add support for CLUSTER SHARDS command (#2507)
* feat: Adding support for CLUSTER SHARDS command

Co-authored-by: Anuragkillswitch <[email protected]>
2023-03-29 21:44:06 +08:00
42d730c143 Add support for CLUSTER LINKS command (#2504)
* feat: Adding support for Cluster Links Command

Co-authored-by: Anuragkillswitch <[email protected]>
2023-03-28 12:19:54 +08:00
984bc2810d Add support for COMMAND GETKEYS & COMMAND GETKEYSANDFLAGS (#2500)
* feat: Adding support for CommandsGetKeysAndFlags & CommandGetKeys

Co-authored-by: Anuragkillswitch <[email protected]>
2023-03-25 18:57:12 +08:00
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 <[email protected]>

* fix: Adding error case test

* fix: adding correct error message

* fix: removed blank lines

---------

Signed-off-by: monkey92t <[email protected]>
Co-authored-by: Anuragkillswitch <[email protected]>
Co-authored-by: monkey92t <[email protected]>
2023-03-24 15:38:11 +08:00
049d4f9691 Add: Support for COMMAND LIST command (#2491)
* feat: add support and tests for Command list command

Co-authored-by: Anuragkillswitch <[email protected]>
2023-03-19 18:20:42 +08:00
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 <[email protected]>

---------

Signed-off-by: monkey92t <[email protected]>
Co-authored-by: monkey92t <[email protected]>
2023-03-09 23:01:37 +08:00