Commit Graph
112 Commits
Author SHA1 Message Date
6193e530d6 chore(docs): fix irrelevant docs links (#3724)
Co-authored-by: Olzhas Sabiyev <[email protected]>
2026-02-28 10:04:30 +02:00
6c6dddcf7c feat: add ParseFailoverURL (#3362)
* add ParseFailoverURL for FailoverOptions
* fix 2 warning

Co-authored-by: Nedyalko Dyakov <[email protected]>
2025-05-15 14:53:40 +03:00
deferdeterandGitHub 9f1522a91e Fix typo in comment (#2972)
Signed-off-by: deferdeter <[email protected]>
2024-04-17 00:02:39 +08: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
ofekshenawaandGitHub 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
a42ba14851 doc: pass ctx in example for infinite wait time (#2540)
Co-authored-by: Monkey <[email protected]>
2023-04-06 00:16:26 +08:00
Vladimir Mihailenco 97b491aace chore: update import path 2023-01-23 08:48:54 +02: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
Vladimir Mihailenco 0dff3d1461 feat: add OpenTelemetry metrics instrumentation 2022-10-12 11:09:41 +03:00
Vladimir Mihailenco 2bcb060d6a chore: update example 2022-10-05 10:06:54 +03:00
Vladimir Mihailenco aaba70a3a7 chore: fix example 2022-10-04 15:09:05 +03:00
Rusty MagnetandGitHub 77dabc3019 docs: another ScanType example with "Hash" as the KeyType (#2212)
* docs: example ScanType call that passes in Hash and gets all keys

* docs: added further example_scantype

* docs: updated comment of ExampleClient_ScanType_Type_Hash
2022-10-04 15:05:14 +03:00
Knut ZuidemaandGitHub 092a692384 refactor: remove unused context attribute from conn (#2150) 2022-07-13 08:49:28 +03:00
Vladimir Mihailenco a18fad5bd3 chore: v9 2022-06-04 17:42:06 +03:00
Bogus Jung 1fdcbf86bb fix: test code 2022-04-28 20:32:58 +09:00
+18 335d946cd6 chore: sync master (#2051)
* Upgrade redis-server version (#1833)

* Upgrade redis-server version

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

* XAutoClaim changed the return value

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

* add cmd: geosearch, geosearchstore (#1836)

* add cmd: geosearch, geosearchstore

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

* GeoSearchQuery and GeoSearchLocationQuery changed to pointer passing

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

* Added missing method XInfoStreamFull to Cmdable interface

* Run go mod tidy in redisotel

Signed-off-by: Bogdan Drutu <[email protected]>

* Revert "ConnPool check  fd for bad conns (#1824)" (#1849)

This reverts commit 346bfafddd.

* Automate release process (#1852)

* Bump github.com/onsi/gomega from 1.10.5 to 1.14.0 (#1832)

* Bump github.com/onsi/gomega from 1.10.5 to 1.14.0

Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.10.5 to 1.14.0.
- [Release notes](https://github.com/onsi/gomega/releases)
- [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/gomega/compare/v1.10.5...v1.14.0)

---
updated-dependencies:
- dependency-name: github.com/onsi/gomega
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Upgrade gomega to v1.15.0

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: monkey92t <[email protected]>

* Add version.go

* Fix otel example

* Fix package name in release script

* More fixes for otel example

* And more

* Fix release.sh

* Release v8.11.3 (release.sh)

* Create an annotated tag to give release.yml chance to run

* Tweak tag.sh

* Add Cmd.Slice helper to cast to []interface{} (#1859)

* after the connection pool is closed, no new connections should be added (#1863)

* after the connection pool is closed, no new connections should be added

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

* remove runGoroutine

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

* pool.popIdle add p.closed check

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

* upgrade golangci-lint v1.42.0

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

* Bump github.com/onsi/gomega from 1.15.0 to 1.16.0 (#1865)

Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.15.0 to 1.16.0.
- [Release notes](https://github.com/onsi/gomega/releases)
- [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/gomega/compare/v1.15.0...v1.16.0)

---
updated-dependencies:
- dependency-name: github.com/onsi/gomega
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add go 1.17 to the build matrix

* Remove go 1.15 from build matrix

* Add scan struct example (#1870)

* Replace release job

* Bump github.com/cespare/xxhash/v2 from 2.1.1 to 2.1.2 (#1872)

Bumps [github.com/cespare/xxhash/v2](https://github.com/cespare/xxhash) from 2.1.1 to 2.1.2.
- [Release notes](https://github.com/cespare/xxhash/releases)
- [Commits](https://github.com/cespare/xxhash/compare/v2.1.1...v2.1.2)

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

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix tag script to push tag by tag

* Fix releasing.md

* Fix/pubsub ping mutex (#1878)

* Fix PubSub.Ping to hold the lock

* Fix PubSub.Ping to hold the lock

* add write cmd data-race test

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

Co-authored-by: monkey92t <[email protected]>

* chore: cleanup OpenTelemetry example

* chore: gofmt all code

* Refactor TestParseURL

This is in preparation for supporting query parameters
in ParseURL:

- use an expected *Options instance to execute assertions on
- extract assertions into helper function
- enable parallel testing
- condense test table

* Add query parameter parsing to ParseURL()

Before this change, ParseURL would only accept a very restricted
set of URLs (it returned an error, if it encountered any parameter).

This commit introduces the ability to process URLs like

	redis://localhost/1?dial_timeout=10s

and similar.

Go programs which were providing a configuration tunable (e.g.
CLI flag, config entry or environment variable) to configure
the Redis connection now don't need to perform this task
themselves.

* chore: add links to readme

* chore: fix discussions link

* empty hooks.withContext removed

* chore: gofmt

* chore: use conventional commits and auto-generate changelog

* feat: add acl auth support for sentinels

* chore: swap to acl auth at the test-level

* Add support for BLMove command

* chore: update dependencies

* chore: update link

* feat: add SetVal method for each command

* feat: add Cmd.{String,Int,Float,Bool}Slice helpers and an example

* chore: tweak GH actions to run all jobs

* chore: add Lua scripting example

* Fix Redis Cluster issue during roll outs of new nodes with same addr (#1914)

* fix: recycle connections in some Redis Cluster scenarios

This issue was surfaced in a Cloud Provider solution that used for
rolling out new nodes using the same address (hostname) of the nodes
that will be replaced in a Redis Cluster, while the former ones once
depromoted as Slaves would continue in service during some mintues
for redirecting traffic.

The solution basically identifies when the connection could be stale
since a MOVED response will be returned using the same address (hostname)
that is being used by the connection. At that moment we consider the
connection as no longer usable forcing to recycle the connection.

* chore: lazy reload when moved or ask

* chore: use conv commit message

* chore: release v8.11.4 (release.sh)

* fix: add whitespace for avoid unlikely colisions

* fix: format

* chore: fix links

* chore: use ctx parameter in cmdInfo

* Bump github.com/onsi/ginkgo from 1.16.4 to 1.16.5 (#1925)

Bumps [github.com/onsi/ginkgo](https://github.com/onsi/ginkgo) from 1.16.4 to 1.16.5.
- [Release notes](https://github.com/onsi/ginkgo/releases)
- [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/ginkgo/compare/v1.16.4...v1.16.5)

---
updated-dependencies:
- dependency-name: github.com/onsi/ginkgo
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: add support for time.Duration write and scan

* test: add test case for setting and scanning durations

* chore: fix linter

* fix(extra/redisotel): set span.kind attribute to client

According to the opentelemetry specification this should always be set to client for database client
libraries.

I've also removed the SetAttributes call and instead set the attributes during creation of the span.
This is what the library SHOULD be doing according to the opentelemetry api specification.

* chore: update otel example

* fix: update some argument counts in pre-allocs

In some cases number of pre-allocated places in
argument array is missing 1 or 2 elements,
which results in re-allocation of twice as large array

* chore: add example how to delete keys without a ttl

* chore: don't enable all lints

* chore(deps): bump github.com/onsi/gomega from 1.16.0 to 1.17.0

Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.16.0 to 1.17.0.
- [Release notes](https://github.com/onsi/gomega/releases)
- [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/gomega/compare/v1.16.0...v1.17.0)

---
updated-dependencies:
- dependency-name: github.com/onsi/gomega
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* feat: Add redis v7's NX, XX, GT, LT expire variants

* chore: add missing readme

* chore: tweak feature links

* chore: remove Discord

* fix: set timeout for WAIT command. Fixes #1963

* build: update `go` directive in `go.mod` to 1.17

This commit enables support for module graph pruning and lazy module
loading for projects that are at Go 1.17 or higher.

Reference: https://go.dev/ref/mod#go-mod-file-go
Reference: https://go.dev/ref/mod#graph-pruning
Reference: https://go.dev/ref/mod#lazy-loading
Signed-off-by: Eng Zer Jun <[email protected]>

* chore: update link

* chore: export cmder.SetFirstKeyPos to support build module commands

* feat(redisotel): ability to override TracerProvider (#1998)

* fix: add missing Expire methods to Cmdable

This is a followup to https://github.com/go-redis/redis/pull/1928

* chore(deps): bump github.com/onsi/gomega from 1.17.0 to 1.18.1

Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.17.0 to 1.18.1.
- [Release notes](https://github.com/onsi/gomega/releases)
- [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/gomega/compare/v1.17.0...v1.18.1)

---
updated-dependencies:
- dependency-name: github.com/onsi/gomega
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Update README.md (#2011)

chore: add fmt library in example code

* chore: instrumentation name and version (#2012)

* fix: invalid type assert in stringArg

* chore: cleanup

* fix: example/otel compile error (#2028)

* fix: rename Golang to Go (#2030)

https://go.dev/doc/faq#go_or_golang

* feat: add support for passing extra attributes added to spans

* feat: set net.peer.name and net.peer.port in otel example

* chore: tweak Uptrace copy

* feat: add support for COPY command (#2016)

* feat: add support for acl sentinel auth in universal client

* chore(deps): bump actions/checkout from 2 to 3

Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore: add hll example

* chore: tweak release script

* chore: release v8.11.5 (release.sh)

* chore: add discord back

Co-authored-by: Eugene Ponizovsky <[email protected]>
Co-authored-by: Bogdan Drutu <[email protected]>
Co-authored-by: Vladimir Mihailenco <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kishan B <[email protected]>
Co-authored-by: Dominik Menke <[email protected]>
Co-authored-by: Gökhan Özeloğlu <[email protected]>
Co-authored-by: Justin Sievenpiper <[email protected]>
Co-authored-by: Алексей Романовский <[email protected]>
Co-authored-by: Stavros Panakakakis <[email protected]>
Co-authored-by: Pau Freixes <[email protected]>
Co-authored-by: Ethan Hur <[email protected]>
Co-authored-by: Jackie <[email protected]>
Co-authored-by: Kristinn Björgvin Árdal <[email protected]>
Co-authored-by: ffenix113 <[email protected]>
Co-authored-by: Bastien Penavayre <[email protected]>
Co-authored-by: James3 Li(李麒傑) <[email protected]>
Co-authored-by: Eng Zer Jun <[email protected]>
Co-authored-by: gzjiangtao2014 <[email protected]>
Co-authored-by: Nelz <[email protected]>
Co-authored-by: Daniel Richter <[email protected]>
Co-authored-by: Seyed Ali Ghaffari <[email protected]>
Co-authored-by: lintanghui <[email protected]>
Co-authored-by: hidu <[email protected]>
Co-authored-by: Jonas Lergell <[email protected]>
Co-authored-by: Alex Kahn <[email protected]>
2022-03-19 12:40:31 +08:00
wjdqhry 4ce90461a5 fix: remove comment 2021-12-22 14:26:40 +09:00
wjdqhry bf334e7738 feat: enable struct on HSet 2021-12-17 11:54:43 +09:00
Dominik Menke dfedc31d20 Add query parameter parsing to ParseURL()
Before this change, ParseURL would only accept a very restricted
set of URLs (it returned an error, if it encountered any parameter).

This commit introduces the ability to process URLs like

	redis://localhost/1?dial_timeout=10s

and similar.

Go programs which were providing a configuration tunable (e.g.
CLI flag, config entry or environment variable) to configure
the Redis connection now don't need to perform this task
themselves.
2021-09-14 18:41:31 +02:00
monkey 83454856c7 Merge branch 'master' into v9
Signed-off-by: monkey <[email protected]>
2021-07-24 22:10:04 +08:00
MengZeLeeandGitHub 704212eaae fix typo (#1829) 2021-07-22 10:27:46 +08:00
63df0e5e75 sync master (#1800)
* Remove OpenTelemetry from the code (but leave redisotel as is) (#1782)

* Add XAutoClaim command (#1780)

* fix typo (#1788)

* xgroup/xadd/xtrim supports new options (#1787)

* support cmd option

XGROUP CREATECONSUMER
XTRIM MINID LIMIT
XADD NOMKSTREAM MINID LIMIT

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

* add XAddArgs.Approx doc

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

* Add Bun to readme

* Upgrade the <sorted set> series of commands (#1792)

* Upgrade the <sorted set> series of commands

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

* Cancel the Deprecated mark of ZAddNX and ZAddXX

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

* Explain the use restrictions of KeepTTL. (#1799)

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

* Adjust KeepTTL annotation.

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

* the hello command throws possible errors, It may affect the "read timeout" test result.

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

Co-authored-by: Vladimir Mihailenco <[email protected]>
Co-authored-by: ericmillin <[email protected]>
Co-authored-by: heyanfu <[email protected]>
2021-06-28 17:40:38 +08:00
monkey92tandGitHub 8ad01240a4 Add support for resp3 protocol (#1739)
* support resp3 protocol

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

* Upgrade mod version limit go1.14

https://github.com/go-redis/redis/issues/1715#issuecomment-820685614

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

* Remove the redundant check of ReadReply

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

* fix the problem

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

* workflows add v9

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

* update StringStringMapCmd to MapStringStringCmd

Signed-off-by: monkey <[email protected]>
2021-04-27 10:04:46 +03:00
Kailash Nadh 600f1665a0 Add missing error checks and support for MGET in Scan() 2021-02-03 13:43:04 +05:30
Kailash Nadh e113512c18 Add example showing scanning to struct 2021-02-02 16:28:35 +05:30
Leandro Forain c2351b491a Add ScanType command to Scan with 'type' option
As of version 6.0 you can use this 'type' option to ask SCAN to only
return objects that match a given type, allowing you to
iterate through the database looking for keys of a specific type.
2021-01-09 09:20:35 -03:00
TwinProduction cc71f5d293 Add SetEX command 2020-10-22 14:38:36 -04:00
Vladimir Mihailenco cbce5dbfa2 Add Sentinel RouteBy 2020-09-11 16:06:08 +03:00
Vladimir Mihailenco 690d9a94f3 Rename SlowLog to SlowLogGet 2020-09-09 18:09:26 +03:00
Ehsan AfzaliandVladimir Mihailenco 6c85ee767a Add NewFailoverClusterClient 2020-09-09 15:37:52 +03:00
Vladimir Mihailenco dfae0ec28b Cleanup 2020-09-09 12:49:45 +03:00
wziwwandVladimir Mihailenco be9ae84c6f support for slowlog command 2020-09-09 12:36:25 +03:00
Vladimir Mihailenco 14c843ef89 gofumports 2020-07-16 09:52:07 +03:00
Vladimir Mihailenco 736fa28659 Cleanup 2020-06-10 15:04:12 +03:00
Vladimir Mihailenco 558263e5eb Remove deprecated Ring options 2020-05-19 08:52:38 +03:00
Vladimir Mihailenco 3dcb844106 Bump major version 2020-05-19 08:52:38 +03:00
Vladimir Mihailenco f5593121e0 Add ctx as first arg 2020-05-19 08:52:38 +03:00
Vladimir Mihailenco 49a0c8c319 Add test for ring and cluster hooks 2020-02-14 14:30:40 +02:00
Vladimir Mihailenco dd4ef4e9cb Change Tx.Pipeline and Tx.TxPipeline meaning 2020-01-12 14:19:21 +02:00
Vladimir Mihailenco 472322938c Use shorter name in example 2019-08-18 17:24:17 +03:00
Vladimir Mihailenco 7779accbea Use semantic import versioning 2019-08-08 14:29:44 +03:00
Vladimir Mihailenco 4e9cea8876 Add proper SingleConnPool implementation 2019-08-03 17:31:28 +03:00
mingrammer c9fed25a60 Support default redis address 2019-01-13 17:36:38 +09:00
Pascal S. de Kloe 38381402f6 FIX: WATCH example stack protection (with retry count) + comment transaction steps. 2018-12-19 21:57:44 +01:00
Issac TrottsandGitHub e99b0688d6 use more idiomatic for loop in ExamplePubSub 2018-10-03 16:36:21 -07:00
Vladimir Mihailenco 48e9afe2a7 Use PubSub.Channel to not burn CPU on errors 2018-10-01 11:43:26 +03:00
Vladimir Mihailenco 0197108027 Use bufio.Writer 2018-08-17 14:14:02 +03:00
Vladimir Mihailenco fea1be3727 Replace client with redisdb in examples 2018-08-12 11:45:35 +03:00
Vladimir Mihailenco d5fc79d4ee Add Client.Do 2018-08-12 11:20:24 +03:00