1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-06 01:01:12 +03:00
Commit Graph

2612 Commits

Author SHA1 Message Date
0b34b1909a feat(command): add ACL commands, validate module categories exist (#3262)
* add ACL{SetUser,DelUser,List} commands

* test presence of categories in acl cat

* code cleanup

* add basic acl tests

* add acl modules tests

* reset acl log before test

* refactor acl tests

* fix clientkillbyage test
2025-02-05 15:44:09 +02:00
3d4310ae96 feat(options): add skip_verify param (#3216)
* feat(options): Add skip_verify param

When parsing a URL, add a "skip_verify" query param to disable TLS certificate
verification.

Inspired by various Go drivers:

* ClickHouse: https://github.com/ClickHouse/clickhouse-go/blob/v2.30.0/clickhouse_options.go#L259
* MongoDB: https://github.com/mongodb/mongo-go-driver/blob/v2.0.0/x/mongo/driver/connstring/connstring.go#L609
* MySQL: https://github.com/go-sql-driver/mysql/blob/v1.8.1/dsn.go#L175

Signed-off-by: Julien Riou <julien@riou.xyz>

* docs(options): Add skip_verify to ParseURL

Signed-off-by: Julien Riou <julien@riou.xyz>

---------

Signed-off-by: Julien Riou <julien@riou.xyz>
Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
2025-02-04 11:34:08 +02:00
d8a9655c21 chore(deps): bump github.com/cespare/xxhash/v2 from 2.2.0 to 2.3.0 (#2964)
Bumps [github.com/cespare/xxhash/v2](https://github.com/cespare/xxhash) from 2.2.0 to 2.3.0.
- [Commits](https://github.com/cespare/xxhash/compare/v2.2.0...v2.3.0)

---
updated-dependencies:
- dependency-name: github.com/cespare/xxhash/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
2025-02-04 10:28:08 +02:00
beb8692fc3 chore: fix some comments (#3226)
Signed-off-by: zhuhaicity <zhuhai@52it.net>
Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
2025-02-03 19:29:02 +02:00
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
d0fb810b13 Fix race condition in clusterNodes.Addrs() (#3219)
Resolve a race condition in the clusterNodes.Addrs() method.
Previously, the method returned a reference to a string slice, creating
the potential for concurrent reads by the caller while the slice was
being modified by the garbage collection process.

Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
2025-02-03 16:15:00 +02:00
1139bc3aa9 fix(tests): enable testing with Redis CE 8.0-M4 in CI (#3247)
* introduce github workflow for ci similar to the one in redis-py

use prerelease for 8.0-M4

* Enable osscluster tests in CI

* Add redis major version env

Enable filtering test per redis major version
Fix test for FT.SEARCH WITHSCORE, the default scorer
has changed.

fix Makefile syntax

remove filter from github action

fix makefile

use the container name in Makefile

* remove 1.20 from doctests

* self review, cleanup, add comments

* add comments, reorder prints, add default value for REDIS_MAJOR_VERSION
2025-01-31 16:14:11 +02:00
9f9fa221a8 DOC-4444 server management command examples (#3235) 2025-01-31 14:57:14 +02:00
1b4abd6dc6 chore(deps): bump golang.org/x/net in /example/otel (#3243)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.23.0 to 0.33.0.
- [Commits](https://github.com/golang/net/compare/v0.23.0...v0.33.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nedyalko Dyakov <nedyalko.dyakov@gmail.com>
2025-01-29 17:56:20 +02:00
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 787c41f429.

* add dockers directory to gitignore
2025-01-23 14:47:28 +02:00
efe0f65bf0 Order slices of strings to be sure what the output of Println in doctests will be. (#3241)
* Sort the slices of strings in doctest to make the output deterministic

* fix wording
2025-01-20 11:32:10 +02:00
0e3ea5fd6b DOC-4449 hash command examples (#3229)
* DOC-4450 added hgetall and hvals doc examples

* DOC-4449 added hgetall and hvals doc examples

* DOC-4449 rewrote to avoid Collect and Keys functions (not available in test version of Go)

* DOC-4449 replaced slices.Sort function with older alternative

* DOC-4449 removed another instance of slices.Sort

* DOC-4449 fixed bugs in tests

* DOC-4449 try sort.Strings() for sorting key lists

---------

Co-authored-by: Vladyslav Vildanov <117659936+vladvildanov@users.noreply.github.com>
2025-01-17 13:02:55 +02:00
f3a15c401e DOC-4560 pipelines/transactions example (#3202)
* DOC-4560 basic transaction example

* DOC-4560 added pipe/transaction examples
2025-01-17 10:29:51 +02:00
e953b76fdb Fix Redis CE tests (#3233)
* Fix Redis CE tests

* Remove manually modules installation
2025-01-15 11:24:47 +02:00
91dddc2e11 Test against Redis CE (#3191)
* Create workflow that tests go-redis against docker

* Add docker compose file

* Add docker compose file

* Change command in docker compose

* Load modules locally

* test varios redis versions

* add env var to test-redis-enterprise action

* cleaning code

* cleaning code
2024-12-16 19:04:39 +02:00
caa2592db7 chore(deps): bump codecov/codecov-action from 4 to 5 (#3196)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4 to 5.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v4...v5)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
2024-12-05 10:11:12 +02:00
73cc5f7c21 SortByWithCount FTSearchOptions fix (#3201)
* SortByWithCount FTSearchOptions fix

* FTSearch test fix

* Another FTSearch test fix

* Another FTSearch test fix

---------

Co-authored-by: Christopher Golling <Chris.Golling@aexp.com>
2024-12-05 10:10:04 +02:00
e63669e170 chore(deps): bump rojopolis/spellcheck-github-actions (#3188)
Bumps [rojopolis/spellcheck-github-actions](https://github.com/rojopolis/spellcheck-github-actions) from 0.40.0 to 0.45.0.
- [Release notes](https://github.com/rojopolis/spellcheck-github-actions/releases)
- [Changelog](https://github.com/rojopolis/spellcheck-github-actions/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rojopolis/spellcheck-github-actions/compare/0.40.0...0.45.0)

---
updated-dependencies:
- dependency-name: rojopolis/spellcheck-github-actions
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
2024-11-21 14:38:38 +02:00
fc32d0a01d Recognize byte slice for key argument in cluster client hash slot computation (#3049)
Co-authored-by: Vladyslav Vildanov <117659936+vladvildanov@users.noreply.github.com>
Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
2024-11-21 14:38:11 +02:00
f1ffb55c9a Only check latencies once every 10 seconds with routeByLatency (#2795)
* Only check latencies once every 10 seconds with `routeByLatency`

`routeByLatency` currently checks latencies any time a server returns
a MOVED or READONLY reply. When a shard is down, the ClusterClient
chooses to issue the request to a random server, which returns a MOVED
reply. This causes a state refresh and a latency update on all servers.
This can lead to significant ping load to clusters with a large number
of clients.

This introduces logic to ping only once every 10 seconds, only
performing a latency update on a node during the `GC` function if the
latency was set later than 10 seconds ago.

Fixes https://github.com/redis/go-redis/issues/2782

* use UnixNano instead of Unix for better precision

---------

Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
2024-11-20 14:36:39 +02:00
080e051124 Eliminate redundant dial mutex causing unbounded connection queue contention (#3088)
* Eliminate redundant dial mutex causing unbounded connection queue contention

* Dialer connection timeouts unit test

---------

Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
2024-11-20 13:38:06 +02:00
930d904205 Add guidance on unstable RESP3 support for RediSearch commands to README (#3177)
* Add UnstableResp3 to docs

* Add RawVal and RawResult to wordlist

* Explain more about SetVal

* Add UnstableResp to wordlist
2024-11-13 13:20:59 +02:00
8b1073d2d6 Support Probabilistic commands with RESP 2 protocol (#3176)
* Support bloom resp 2

* Support Resp2 for BF.Info

* simplify BFInfoCmd field assignment using map-based key-to-field references
2024-11-13 11:15:19 +02:00
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
80c9f5bb77 DOC-4345 added JSON samples for home page (#3183) 2024-11-06 17:25:46 +02:00
1ed936eb09 DOC-4232 stream code examples (#3128)
* DOC-4232 added first stream example

* DOC-4232 examples up to xadd_7

* DOC-4232 examples up to xread

* DOC-4232 examples up to xclaim

* DOC-4232 added remaining examples

* DOC-4232 more fixes

* DOC-4232 fix for test fail on CI build

---------

Co-authored-by: Vladyslav Vildanov <117659936+vladvildanov@users.noreply.github.com>
2024-10-23 17:47:25 +03:00
cc9bcb0c0f Updated package version (#3158) extra/redisotel/v9.6.2 extra/rediscmd/v9.6.2 2024-10-15 16:32:53 +03:00
a8590e9879 Fix field name spellings (#3132)
Co-authored-by: Vladyslav Vildanov <117659936+vladvildanov@users.noreply.github.com>
extra/redisprometheus/v9.6.2 extra/rediscensus/v9.6.2
2024-10-14 16:52:50 +03:00
2076975008 Support Json with Resp 2 (#3146)
* Support ReJSON resp 2 && Test ReJSON against RESP 2 and 3 && Add complex search and json test

* Remove comments

* Remove unnecessary changes
2024-10-14 14:37:22 +03:00
7d56a2c38d DOC-4328 added DEL, EXPIRE, and TTL command examples (#3143)
Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
2024-10-09 13:44:29 +03:00
e69895b94d DOC-4324 added ZADD and ZRANGE command examples (#3142)
Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
2024-10-09 13:42:24 +03:00
f467d014a4 DOC-4323 added INCR command example (#3141)
Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
2024-10-09 13:40:21 +03:00
0c84b6231f DOC-4322 added HSET/HGET command page examples (#3140)
Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
2024-10-09 13:38:32 +03:00
7fc46e206b DOC-4233 added geospatial examples (#3126)
Co-authored-by: Vladyslav Vildanov <117659936+vladvildanov@users.noreply.github.com>
Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
2024-10-09 13:36:42 +03:00
bef6b10d6f DOC-4240 added Top-K examples (#3119)
Co-authored-by: Vladyslav Vildanov <117659936+vladvildanov@users.noreply.github.com>
Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
2024-10-09 13:33:46 +03:00
e3d41f20f7 DOC-4235 added bitfield examples (#3125)
Co-authored-by: Vladyslav Vildanov <117659936+vladvildanov@users.noreply.github.com>
Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
2024-10-09 13:31:14 +03:00
13682c437e DOC-4239 added Count-min sketch examples (#3118)
Co-authored-by: Vladyslav Vildanov <117659936+vladvildanov@users.noreply.github.com>
Co-authored-by: ofekshenawa <104765379+ofekshenawa@users.noreply.github.com>
2024-10-09 13:24:47 +03:00
7cc1e32e03 DOC-4236 added HyperLogLog examples (#3117)
Co-authored-by: Vladyslav Vildanov <117659936+vladvildanov@users.noreply.github.com>
2024-10-09 09:14:34 +03:00
5d03e9ec33 DOC-4238 added Cuckoo filter examples (#3116)
Co-authored-by: Vladyslav Vildanov <117659936+vladvildanov@users.noreply.github.com>
2024-10-09 08:56:44 +03:00
e7868623ac Remove direct read from TLS underlying conn (#3138) 2024-10-07 12:23:11 +03:00
d9eeed131a Fix Flaky Test: should handle FTAggregate with Unstable RESP3 Search Module and without stability (#3135) 2024-09-26 13:11:59 +03:00
e99abe4546 DOC-4237 added Bloom filter examples (#3115)
Co-authored-by: Vladyslav Vildanov <117659936+vladvildanov@users.noreply.github.com>
2024-09-26 10:41:54 +03:00
9e79c9bd39 DOC-4228 JSON code examples (#3114)
* DOC-4228 added JSON code examples

* DOC-4228 example and formatting corrections

---------

Co-authored-by: Vladyslav Vildanov <117659936+vladvildanov@users.noreply.github.com>
2024-09-26 10:24:21 +03:00
9e3709c404 DOC-4234 added bitmap examples (#3124)
Co-authored-by: Vladyslav Vildanov <117659936+vladvildanov@users.noreply.github.com>
2024-09-25 21:03:54 +03:00
69b4c0165f DOC-4241 added t-digest examples (#3123) 2024-09-25 19:54:20 +03:00
233f97accd DOC-4229 sorted set code examples (#3113)
* DOC-4229 added sorted set doc examples

* DOC-4229 wrapped long lines

---------

Co-authored-by: Vladyslav Vildanov <117659936+vladvildanov@users.noreply.github.com>
2024-09-12 16:26:16 +03:00
af13ee34f9 DOC-4231 added set datatype examples (#3111)
Co-authored-by: Vladyslav Vildanov <117659936+vladvildanov@users.noreply.github.com>
2024-09-12 14:16:15 +03:00
79ed39adcc DOC-4230 list doc code examples (#3110)
* DOC-4230 list tutorial examples

* DOC-4230 added missing printout comment

* DOC-4230 added set datatype examples

* Revert "DOC-4230 added set datatype examples"

This reverts commit 4f208aaf7b.

---------

Co-authored-by: Vladyslav Vildanov <117659936+vladvildanov@users.noreply.github.com>
2024-09-12 13:54:42 +03:00
04f642ff5e Doc 4226 hash tces (#3106)
* DOC-4226 hash examples for docs

* DOC-4226 added hash scan examples

* DOC-4226 fixed test output issues

---------

Co-authored-by: Vladyslav Vildanov <117659936+vladvildanov@users.noreply.github.com>
2024-09-12 11:45:38 +03: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 <117659936+vladvildanov@users.noreply.github.com>
Co-authored-by: vladvildanov <divinez122@outlook.com>
2024-09-12 11:26:10 +03:00