Skip to content

chore: sync master #2051

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 128 commits into from
Mar 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
437184b
Upgrade redis-server version (#1833)
monkey92t Jul 24, 2021
7dad93e
add cmd: geosearch, geosearchstore (#1836)
monkey92t Jul 28, 2021
2ca559d
Added missing method XInfoStreamFull to Cmdable interface
iph0 Aug 5, 2021
67082aa
Run go mod tidy in redisotel
bogdandrutu Aug 5, 2021
ad880a9
Merge pull request #1847 from bogdandrutu/otelredis
vmihailenco Aug 6, 2021
67ae445
Merge pull request #1845 from iph0/master
vmihailenco Aug 6, 2021
fd3025b
Revert "ConnPool check fd for bad conns (#1824)" (#1849)
monkey92t Aug 6, 2021
5e89d62
Automate release process (#1852)
vmihailenco Aug 11, 2021
047f907
Bump github.com/onsi/gomega from 1.10.5 to 1.14.0 (#1832)
dependabot[bot] Aug 12, 2021
818c0e0
Add version.go
vmihailenco Aug 12, 2021
98ed2cb
Fix otel example
vmihailenco Aug 12, 2021
084dcde
Fix package name in release script
vmihailenco Aug 12, 2021
9cd9efd
More fixes for otel example
vmihailenco Aug 12, 2021
f02921d
And more
vmihailenco Aug 12, 2021
493a4d0
Fix release.sh
vmihailenco Aug 12, 2021
702e7cf
Release v8.11.3 (release.sh)
vmihailenco Aug 12, 2021
74f9a73
Merge pull request #1853 from go-redis/release/v8.11.3
vmihailenco Aug 12, 2021
4ed306d
Create an annotated tag to give release.yml chance to run
vmihailenco Aug 12, 2021
4029656
Tweak tag.sh
vmihailenco Aug 12, 2021
bc9d5c8
Add Cmd.Slice helper to cast to []interface{} (#1859)
vmihailenco Aug 13, 2021
afafeda
after the connection pool is closed, no new connections should be add…
monkey92t Aug 19, 2021
db669da
Bump github.com/onsi/gomega from 1.15.0 to 1.16.0 (#1865)
dependabot[bot] Aug 23, 2021
83f70de
Add go 1.17 to the build matrix
kishaningithub Aug 24, 2021
3d2164e
Remove go 1.15 from build matrix
kishaningithub Aug 24, 2021
989295a
Merge pull request #1867 from kishaningithub/patch-1
vmihailenco Aug 24, 2021
ed42d3c
Add scan struct example (#1870)
vmihailenco Aug 29, 2021
5e6479e
Replace release job
vmihailenco Aug 30, 2021
7fc0d6b
Bump github.com/cespare/xxhash/v2 from 2.1.1 to 2.1.2 (#1872)
dependabot[bot] Aug 31, 2021
0c6ce84
Fix tag script to push tag by tag
vmihailenco Sep 1, 2021
c16c45c
Merge branch 'master' of github.com:go-redis/redis
vmihailenco Sep 1, 2021
917c476
Fix releasing.md
vmihailenco Sep 3, 2021
b94bde3
Fix/pubsub ping mutex (#1878)
vmihailenco Sep 3, 2021
11c4d6f
chore: cleanup OpenTelemetry example
vmihailenco Sep 8, 2021
9b6ee9c
chore: gofmt all code
vmihailenco Sep 8, 2021
0982b38
Merge pull request #1882 from go-redis/chore/otel-example
vmihailenco Sep 10, 2021
3ac3452
Refactor TestParseURL
dmke Sep 10, 2021
dfedc31
Add query parameter parsing to ParseURL()
dmke Sep 10, 2021
0af8700
chore: add links to readme
vmihailenco Sep 15, 2021
7ecd5ce
chore: fix discussions link
vmihailenco Sep 15, 2021
9971188
Merge pull request #1884 from dmke/feat/parseurl
vmihailenco Sep 15, 2021
028aeaa
empty hooks.withContext removed
gozeloglu Sep 16, 2021
aac0ea4
Merge pull request #1891 from gozeloglu/rmv-empty-fnc
vmihailenco Sep 17, 2021
7c92957
chore: gofmt
vmihailenco Sep 17, 2021
30a3028
chore: use conventional commits and auto-generate changelog
vmihailenco Sep 17, 2021
f66582f
feat: add acl auth support for sentinels
jsievenpiper Sep 18, 2021
c575887
Merge pull request #1895 from go-redis/fix/conv-commits
vmihailenco Sep 18, 2021
f74ce7d
chore: swap to acl auth at the test-level
jsievenpiper Sep 19, 2021
f36093a
Add support for BLMove command
alexus1024 Sep 20, 2021
fddf086
Merge pull request #1896 from jsievenpiper/main
vmihailenco Sep 22, 2021
8648971
Merge pull request #1899 from alexus1024/master
vmihailenco Sep 23, 2021
3f99e7b
chore: update dependencies
vmihailenco Sep 23, 2021
e2ecabe
Merge pull request #1904 from go-redis/fix/upd-dependencies
vmihailenco Sep 23, 2021
afd8445
chore: update link
vmihailenco Sep 24, 2021
168981d
feat: add SetVal method for each command
Stavrospanakakis Sep 25, 2021
329d87f
Merge pull request #1906 from Stavrospanakakis/master
vmihailenco Sep 26, 2021
5d3d293
feat: add Cmd.{String,Int,Float,Bool}Slice helpers and an example
vmihailenco Sep 27, 2021
cc09f96
Merge pull request #1909 from go-redis/feature/slice-helpers
vmihailenco Sep 27, 2021
739c188
chore: tweak GH actions to run all jobs
vmihailenco Sep 27, 2021
5072031
chore: add Lua scripting example
vmihailenco Sep 27, 2021
98bb99d
Fix Redis Cluster issue during roll outs of new nodes with same addr …
pfreixes Oct 4, 2021
86258a1
chore: lazy reload when moved or ask
vmihailenco Oct 4, 2021
6dcfc56
chore: use conv commit message
vmihailenco Oct 4, 2021
0457d0a
chore: release v8.11.4 (release.sh)
vmihailenco Oct 4, 2021
fa51524
Merge pull request #1917 from go-redis/release/v8.11.4
vmihailenco Oct 4, 2021
7f7c181
fix: add whitespace for avoid unlikely colisions
pfreixes Oct 4, 2021
96f53a0
fix: format
pfreixes Oct 4, 2021
40c1cc3
Merge pull request #1918 from pfreixes/add_whitespace_before_addr
vmihailenco Oct 5, 2021
acf1c18
chore: fix links
vmihailenco Oct 5, 2021
2b6611c
Merge branch 'master' of github.com:go-redis/redis
vmihailenco Oct 5, 2021
a67d912
chore: use ctx parameter in cmdInfo
HurSungYun Oct 15, 2021
ca2b163
Merge pull request #1922 from HurSungYun/cmdInfo_logging_context
vmihailenco Oct 15, 2021
0260525
Bump github.com/onsi/ginkgo from 1.16.4 to 1.16.5 (#1925)
dependabot[bot] Oct 18, 2021
2f1b74e
feat: add support for time.Duration write and scan
Pyrodash Oct 21, 2021
a2a463b
test: add test case for setting and scanning durations
Pyrodash Oct 22, 2021
a52a508
Merge pull request #1930 from Pyrodash/master
vmihailenco Oct 24, 2021
38d398f
chore: fix linter
vmihailenco Oct 24, 2021
065b200
fix(extra/redisotel): set span.kind attribute to client
kristinnardal2 Oct 26, 2021
25378ca
Merge pull request #1934 from kristinnardal2/redisotel-span-kind
vmihailenco Oct 27, 2021
c7e913c
chore: update otel example
vmihailenco Nov 5, 2021
47ac23e
Merge branch 'master' of github.com:go-redis/redis
vmihailenco Nov 5, 2021
f6974eb
fix: update some argument counts in pre-allocs
Nov 5, 2021
9b48b5e
chore: add example how to delete keys without a ttl
vmihailenco Nov 19, 2021
383aa36
chore: don't enable all lints
vmihailenco Nov 19, 2021
dabd395
Merge pull request #1952 from go-redis/chore/del-keys-without-ttl
vmihailenco Nov 20, 2021
1790c2b
chore(deps): bump github.com/onsi/gomega from 1.16.0 to 1.17.0
dependabot[bot] Nov 20, 2021
10b3668
Merge pull request #1940 from ffenix113/master
vmihailenco Nov 21, 2021
5aefa73
Merge pull request #1942 from go-redis/dependabot/go_modules/github.c…
vmihailenco Nov 21, 2021
e19bbb2
feat: Add redis v7's NX, XX, GT, LT expire variants
DaemonSnake Nov 21, 2021
5c9b845
chore: add missing readme
vmihailenco Nov 23, 2021
cc87acb
chore: tweak feature links
Nov 25, 2021
e9a8bb4
Merge pull request #1954 from Ci-Jie/bugfix/tweak-some-feature-links
vmihailenco Nov 25, 2021
f737d9a
chore: remove Discord
vmihailenco Dec 24, 2021
333fee1
fix: set timeout for WAIT command. Fixes #1963
vmihailenco Dec 26, 2021
4633890
build: update `go` directive in `go.mod` to 1.17
Juneezee Dec 27, 2021
955df2c
chore: update link
vmihailenco Dec 29, 2021
f4bf09c
chore: export cmder.SetFirstKeyPos to support build module commands
Jan 11, 2022
f1dd3d5
Merge pull request #1968 from Juneezee/go1.17
vmihailenco Jan 12, 2022
bf8d4aa
feat(redisotel): ability to override TracerProvider (#1998)
nelz9999 Jan 18, 2022
17e3b43
fix: add missing Expire methods to Cmdable
Richtermeister Jan 22, 2022
2321414
Merge pull request #2001 from Richtermeister/patch-2
vmihailenco Jan 23, 2022
4ddcf48
chore(deps): bump github.com/onsi/gomega from 1.17.0 to 1.18.1
dependabot[bot] Jan 31, 2022
e2d145d
Update README.md (#2011)
alighdev Jan 31, 2022
3ecadf5
chore: instrumentation name and version (#2012)
nelz9999 Feb 2, 2022
8ed766b
Merge pull request #2010 from go-redis/dependabot/go_modules/github.c…
vmihailenco Feb 2, 2022
a034b08
Merge pull request #1991 from jiangtao244/master
vmihailenco Feb 2, 2022
de6c131
fix: invalid type assert in stringArg
lintanghui Feb 18, 2022
ed1b5bb
Merge pull request #2027 from lintanghui/master
vmihailenco Feb 18, 2022
b096f43
chore: cleanup
vmihailenco Feb 18, 2022
187c07c
fix: example/otel compile error (#2028)
Feb 18, 2022
aa1530a
Merge pull request #2029 from hidu/master
vmihailenco Feb 19, 2022
b82a2d9
fix: rename Golang to Go (#2030)
Feb 20, 2022
c898357
Merge pull request #2031 from hidu/master
vmihailenco Feb 22, 2022
39faaa1
feat: add support for passing extra attributes added to spans
Feb 22, 2022
69bf454
feat: set net.peer.name and net.peer.port in otel example
Feb 22, 2022
6fd61e8
chore: tweak Uptrace copy
vmihailenco Feb 22, 2022
627f4da
Merge pull request #2033 from thrawny/feature/otel-attributes
vmihailenco Feb 22, 2022
730afbc
feat: add support for COPY command (#2016)
akahn Feb 27, 2022
ab0ccc4
feat: add support for acl sentinel auth in universal client
jsievenpiper Feb 28, 2022
65e242e
Merge pull request #2039 from jsievenpiper/sentinel-universal
vmihailenco Mar 1, 2022
cfc0812
chore(deps): bump actions/checkout from 2 to 3
dependabot[bot] Mar 7, 2022
d28f1f8
Merge pull request #2042 from go-redis/dependabot/github_actions/acti…
vmihailenco Mar 16, 2022
dbd417a
chore: add hll example
vmihailenco Mar 17, 2022
04b1478
Merge branch 'master' of github.com:go-redis/redis
vmihailenco Mar 17, 2022
081bf6b
chore: tweak release script
vmihailenco Mar 17, 2022
6f7d7a1
chore: release v8.11.5 (release.sh)
vmihailenco Mar 17, 2022
cae6772
Merge pull request #2050 from go-redis/release/v8.11.5
vmihailenco Mar 17, 2022
40e84a7
chore: add discord back
vmihailenco Mar 18, 2022
82e8a89
chore: Merge branch 'master' into v9
monkey92t Mar 19, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
custom: ['https://uptrace.dev']
custom: ['https://uptrace.dev/sponsor']
3 changes: 0 additions & 3 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,3 @@ contact_links:
- name: Discussions
url: https://github.com/go-redis/redis/discussions
about: Ask a question via GitHub Discussions
- name: Discord
url: https://discord.gg/rWtp5Aj
about: Ask a question via Discord
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ jobs:
name: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go-version: [1.15.x, 1.16.x]
go-version: [1.16.x, 1.17.x]

services:
redis:
Expand All @@ -29,7 +30,7 @@ jobs:
go-version: ${{ matrix.go-version }}

- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Test
run: make test
11 changes: 11 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Lint Commit Messages
on: [pull_request]

jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v4
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
17 changes: 17 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Releases

on:
push:
tags:
- 'v*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ncipollo/release-action@v1
with:
body:
Please refer to
[CHANGELOG.md](https://github.com/go-redis/redis/blob/master/CHANGELOG.md) for details
22 changes: 0 additions & 22 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,3 @@ run:
concurrency: 8
deadline: 5m
tests: false
linters:
enable-all: true
disable:
- funlen
- gochecknoglobals
- gochecknoinits
- gocognit
- goconst
- godox
- gosec
- maligned
- wsl
- gomnd
- goerr113
- exhaustive
- nestif
- nlreturn
- exhaustivestruct
- wrapcheck
- errorlint
- cyclop
- forcetypeassert
File renamed without changes.
40 changes: 37 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,41 @@
# Changelog
## [8.11.5](https://github.com/go-redis/redis/compare/v8.11.4...v8.11.5) (2022-03-17)


### Bug Fixes

* add missing Expire methods to Cmdable ([17e3b43](https://github.com/go-redis/redis/commit/17e3b43879d516437ada71cf9c0deac6a382ed9a))
* add whitespace for avoid unlikely colisions ([7f7c181](https://github.com/go-redis/redis/commit/7f7c1817617cfec909efb13d14ad22ef05a6ad4c))
* example/otel compile error ([#2028](https://github.com/go-redis/redis/issues/2028)) ([187c07c](https://github.com/go-redis/redis/commit/187c07c41bf68dc3ab280bc3a925e960bbef6475))
* **extra/redisotel:** set span.kind attribute to client ([065b200](https://github.com/go-redis/redis/commit/065b200070b41e6e949710b4f9e01b50ccc60ab2))
* format ([96f53a0](https://github.com/go-redis/redis/commit/96f53a0159a28affa94beec1543a62234e7f8b32))
* invalid type assert in stringArg ([de6c131](https://github.com/go-redis/redis/commit/de6c131865b8263400c8491777b295035f2408e4))
* rename Golang to Go ([#2030](https://github.com/go-redis/redis/issues/2030)) ([b82a2d9](https://github.com/go-redis/redis/commit/b82a2d9d4d2de7b7cbe8fcd4895be62dbcacacbc))
* set timeout for WAIT command. Fixes [#1963](https://github.com/go-redis/redis/issues/1963) ([333fee1](https://github.com/go-redis/redis/commit/333fee1a8fd98a2fbff1ab187c1b03246a7eb01f))
* update some argument counts in pre-allocs ([f6974eb](https://github.com/go-redis/redis/commit/f6974ebb5c40a8adf90d2cacab6dc297f4eba4c2))


### Features

* Add redis v7's NX, XX, GT, LT expire variants ([e19bbb2](https://github.com/go-redis/redis/commit/e19bbb26e2e395c6e077b48d80d79e99f729a8b8))
* add support for acl sentinel auth in universal client ([ab0ccc4](https://github.com/go-redis/redis/commit/ab0ccc47413f9b2a6eabc852fed5005a3ee1af6e))
* add support for COPY command ([#2016](https://github.com/go-redis/redis/issues/2016)) ([730afbc](https://github.com/go-redis/redis/commit/730afbcffb93760e8a36cc06cfe55ab102b693a7))
* add support for passing extra attributes added to spans ([39faaa1](https://github.com/go-redis/redis/commit/39faaa171523834ba527c9789710c4fde87f5a2e))
* add support for time.Duration write and scan ([2f1b74e](https://github.com/go-redis/redis/commit/2f1b74e20cdd7719b2aecf0768d3e3ae7c3e781b))
* **redisotel:** ability to override TracerProvider ([#1998](https://github.com/go-redis/redis/issues/1998)) ([bf8d4aa](https://github.com/go-redis/redis/commit/bf8d4aa60c00366cda2e98c3ddddc8cf68507417))
* set net.peer.name and net.peer.port in otel example ([69bf454](https://github.com/go-redis/redis/commit/69bf454f706204211cd34835f76b2e8192d3766d))



## [8.11.4](https://github.com/go-redis/redis/compare/v8.11.3...v8.11.4) (2021-10-04)


### Features

* add acl auth support for sentinels ([f66582f](https://github.com/go-redis/redis/commit/f66582f44f3dc3a4705a5260f982043fde4aa634))
* add Cmd.{String,Int,Float,Bool}Slice helpers and an example ([5d3d293](https://github.com/go-redis/redis/commit/5d3d293cc9c60b90871e2420602001463708ce24))
* add SetVal method for each command ([168981d](https://github.com/go-redis/redis/commit/168981da2d84ee9e07d15d3e74d738c162e264c4))


> :heart:
> [**Uptrace.dev** - All-in-one tool to optimize performance and monitor errors & logs](https://uptrace.dev)

## v9 UNRELEASED

Expand Down
19 changes: 14 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
PACKAGE_DIRS := $(shell find . -mindepth 2 -type f -name 'go.mod' -exec dirname {} \; | sort)

test: testdeps
go test ./...
go test ./... -short -race
Expand All @@ -19,8 +21,15 @@ testdata/redis:
testdata/redis/src/redis-server: testdata/redis
cd $< && make all

tag:
git tag $(VERSION)
git tag extra/rediscmd/$(VERSION)
git tag extra/redisotel/$(VERSION)
git tag extra/rediscensus/$(VERSION)
fmt:
gofmt -w -s ./
goimports -w -local github.com/go-redis/redis ./

go_mod_tidy:
go get -u && go mod tidy
set -e; for dir in $(PACKAGE_DIRS); do \
echo "go mod tidy in $${dir}"; \
(cd "$${dir}" && \
go get -u && \
go mod tidy); \
done
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
<p align="center">
<a href="https://uptrace.dev/?utm_source=gh-redis&utm_campaign=gh-redis-banner1">
<img src="https://raw.githubusercontent.com/uptrace/roadmap/master/banner1.png" alt="All-in-one tool to optimize performance and monitor errors & logs">
</a>
</p>

# Redis client for Golang
# Redis client for Go

![build workflow](https://github.com/go-redis/redis/actions/workflows/build.yml/badge.svg)
[![PkgGoDev](https://pkg.go.dev/badge/github.com/go-redis/redis/v8)](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc)
[![Documentation](https://img.shields.io/badge/redis-documentation-informational)](https://redis.uptrace.dev/)
[![Chat](https://discordapp.com/api/guilds/752070105847955518/widget.png)](https://discord.gg/rWtp5Aj)

- Join [Discord](https://discord.gg/rWtp5Aj) to ask questions.
go-redis is brought to you by :star: [**uptrace/uptrace**](https://github.com/uptrace/uptrace).
Uptrace is an open source and blazingly fast **distributed tracing** backend powered by
OpenTelemetry and ClickHouse. Give it a star as well!

## Resources

- [Discussions](https://github.com/go-redis/redis/discussions)
- [Documentation](https://redis.uptrace.dev)
- [Reference](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc)
- [Examples](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc#pkg-examples)
- [RealWorld example app](https://github.com/uptrace/go-treemux-realworld-example-app)

My other projects:
Other projects you may like:

- [Bun](https://bun.uptrace.dev) - fast and simple SQL client for PostgreSQL, MySQL, and SQLite.
- [treemux](https://github.com/vmihailenco/treemux) - high-speed, flexible, tree-based HTTP router
for Go.
- [BunRouter](https://bunrouter.uptrace.dev/) - fast and flexible HTTP router for Go.

## Ecosystem

- [Redis Mock](https://github.com/go-redis/redismock).
- [Distributed Locks](https://github.com/bsm/redislock).
- [Redis Cache](https://github.com/go-redis/cache).
- [Rate limiting](https://github.com/go-redis/redis_rate).
- [Redis Mock](https://github.com/go-redis/redismock)
- [Distributed Locks](https://github.com/bsm/redislock)
- [Redis Cache](https://github.com/go-redis/cache)
- [Rate limiting](https://github.com/go-redis/redis_rate)

## Features

Expand All @@ -37,16 +36,16 @@ My other projects:
[circuit breaker](https://en.wikipedia.org/wiki/Circuit_breaker_design_pattern) support.
- [Pub/Sub](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc#PubSub).
- [Transactions](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc#example-Client-TxPipeline).
- [Pipeline](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc#example-Client-Pipeline) and
[TxPipeline](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc#example-Client-TxPipeline).
- [Pipeline](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc#example-Client.Pipeline) and
[TxPipeline](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc#example-Client.TxPipeline).
- [Scripting](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc#Script).
- [Timeouts](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc#Options).
- [Redis Sentinel](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc#NewFailoverClient).
- [Redis Cluster](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc#NewClusterClient).
- [Cluster of Redis Servers](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc#example-NewClusterClient--ManualSetup)
- [Cluster of Redis Servers](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc#example-NewClusterClient-ManualSetup)
without using cluster mode and Redis Sentinel.
- [Ring](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc#NewRing).
- [Instrumentation](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc#ex-package--Instrumentation).
- [Instrumentation](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc#example-package-Instrumentation).

## Installation

Expand All @@ -70,6 +69,7 @@ go get github.com/go-redis/redis/v8
import (
"context"
"github.com/go-redis/redis/v8"
"fmt"
)

var ctx = context.Background()
Expand Down
15 changes: 15 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Releasing

1. Run `release.sh` script which updates versions in go.mod files and pushes a new branch to GitHub:

```shell
TAG=v1.0.0 ./scripts/release.sh
```

2. Open a pull request and wait for the build to finish.

3. Merge the pull request and run `tag.sh` to create tags for packages:

```shell
TAG=v1.0.0 ./scripts/tag.sh
```
66 changes: 66 additions & 0 deletions bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"context"
"fmt"
"strconv"
"strings"
"sync"
"testing"
Expand Down Expand Up @@ -233,6 +234,45 @@ func BenchmarkZAdd(b *testing.B) {
})
}

func BenchmarkXRead(b *testing.B) {
ctx := context.Background()
client := benchmarkRedisClient(ctx, 10)
defer client.Close()

args := redis.XAddArgs{
Stream: "1",
ID: "*",
Values: map[string]string{"uno": "dos"},
}

lenStreams := 16
streams := make([]string, 0, lenStreams)
for i := 0; i < lenStreams; i++ {
streams = append(streams, strconv.Itoa(i))
}
for i := 0; i < lenStreams; i++ {
streams = append(streams, "0")
}

b.ReportAllocs()
b.ResetTimer()

b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
client.XAdd(ctx, &args)

err := client.XRead(ctx, &redis.XReadArgs{
Streams: streams,
Count: 1,
Block: time.Second,
}).Err()
if err != nil {
b.Fatal(err)
}
}
})
}

var clientSink *redis.Client

func BenchmarkWithContext(b *testing.B) {
Expand Down Expand Up @@ -301,6 +341,32 @@ func BenchmarkClusterPing(b *testing.B) {
})
}

func BenchmarkClusterDoInt(b *testing.B) {
if testing.Short() {
b.Skip("skipping in short mode")
}

ctx := context.Background()
cluster := newClusterScenario()
if err := startCluster(ctx, cluster); err != nil {
b.Fatal(err)
}
defer cluster.Close()

client := cluster.newClusterClient(ctx, redisClusterOptions())
defer client.Close()

b.ResetTimer()
b.RunParallel(func(pb *testing.PB) {
for pb.Next() {
err := client.Do(ctx, "SET", 10, 10).Err()
if err != nil {
b.Fatal(err)
}
}
})
}

func BenchmarkClusterSetString(b *testing.B) {
if testing.Short() {
b.Skip("skipping in short mode")
Expand Down
Loading