Skip to content

Commit 5dcad41

Browse files
authored
Merge branch 'master' into only-update-latency-in-gc-if-stale
2 parents 97cee82 + 6833d2f commit 5dcad41

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1183
-836
lines changed

.github/wordlist.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ ACLs
22
autoload
33
autoloader
44
autoloading
5+
analytics
56
Autoloading
67
backend
78
backends
@@ -13,6 +14,7 @@ customizable
1314
Customizable
1415
dataset
1516
de
17+
DisableIdentity
1618
ElastiCache
1719
extensibility
1820
FPM
@@ -43,6 +45,7 @@ RocksDB
4345
runtime
4446
SHA
4547
sharding
48+
SETNAME
4649
SSL
4750
struct
4851
stunnel

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828

2929
steps:
3030
- name: Set up ${{ matrix.go-version }}
31-
uses: actions/setup-go@v4
31+
uses: actions/setup-go@v5
3232
with:
3333
go-version: ${{ matrix.go-version }}
3434

.github/workflows/doctests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929

3030
steps:
3131
- name: Set up ${{ matrix.go-version }}
32-
uses: actions/setup-go@v4
32+
uses: actions/setup-go@v5
3333
with:
3434
go-version: ${{ matrix.go-version }}
3535

.github/workflows/golangci-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ jobs:
2323
steps:
2424
- uses: actions/checkout@v4
2525
- name: golangci-lint
26-
uses: golangci/golangci-lint-action@v3
26+
uses: golangci/golangci-lint-action@v4

.github/workflows/release-drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
# Drafts your next Release notes as Pull Requests are merged into "master"
19-
- uses: release-drafter/release-drafter@v5
19+
- uses: release-drafter/release-drafter@v6
2020
with:
2121
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
2222
config-name: release-drafter-config.yml

.github/workflows/spellcheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
- name: Checkout
99
uses: actions/checkout@v4
1010
- name: Check Spelling
11-
uses: rojopolis/spellcheck-github-actions@0.34.0
11+
uses: rojopolis/spellcheck-github-actions@0.36.0
1212
with:
1313
config_path: .github/spellcheck-settings.yml
1414
task_name: Markdown

.github/workflows/stale-issues.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/stale@v8
15+
- uses: actions/stale@v9
1616
with:
1717
repo-token: ${{ secrets.GITHUB_TOKEN }}
1818
stale-issue-message: 'This issue is marked stale. It will be closed in 30 days if it is not updated.'
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: RE Tests
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
build:
13+
name: build
14+
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
go-version: [1.21.x]
19+
re-build: ["7.4.2-54"]
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
25+
- name: Clone Redis EE docker repository
26+
uses: actions/checkout@v4
27+
with:
28+
repository: RedisLabs/redis-ee-docker
29+
path: redis-ee
30+
31+
- name: Set up ${{ matrix.go-version }}
32+
uses: actions/setup-go@v5
33+
with:
34+
go-version: ${{ matrix.go-version }}
35+
36+
- name: Build cluster
37+
working-directory: redis-ee
38+
env:
39+
IMAGE: "redislabs/redis:${{ matrix.re-build }}"
40+
RE_USERNAME: [email protected]
41+
RE_PASS: 12345
42+
RE_CLUSTER_NAME: re-test
43+
RE_USE_OSS_CLUSTER: false
44+
RE_DB_PORT: 6379
45+
run: ./build.sh
46+
47+
- name: Test
48+
env:
49+
RE_CLUSTER: "1"
50+
run: |
51+
go test \
52+
--ginkgo.skip-file="ring_test.go" \
53+
--ginkgo.skip-file="sentinel_test.go" \
54+
--ginkgo.skip-file="osscluster_test.go" \
55+
--ginkgo.skip-file="pubsub_test.go" \
56+
--ginkgo.skip-file="gears_commands_test.go" \
57+
--ginkgo.label-filter='!NonRedisEnterprise'

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
GO_MOD_DIRS := $(shell find . -type f -name 'go.mod' -exec dirname {} \; | sort)
22

33
test: testdeps
4+
$(eval GO_VERSION := $(shell go version | cut -d " " -f 3 | cut -d. -f2))
45
set -e; for dir in $(GO_MOD_DIRS); do \
6+
if echo "$${dir}" | grep -q "./example" && [ "$(GO_VERSION)" = "19" ]; then \
7+
echo "Skipping go test in $${dir} due to Go version 1.19 and dir contains ./example"; \
8+
continue; \
9+
fi; \
510
echo "go test in $${dir}"; \
611
(cd "$${dir}" && \
712
go mod tidy -compat=1.18 && \

README.md

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ key value NoSQL database that uses RocksDB as storage engine and is compatible w
5151

5252
## Features
5353

54-
- Redis 3 commands except QUIT, MONITOR, and SYNC.
55-
- Automatic connection pooling with
54+
- Redis commands except QUIT and SYNC.
55+
- Automatic connection pooling.
5656
- [Pub/Sub](https://redis.uptrace.dev/guide/go-redis-pubsub.html).
5757
- [Pipelines and transactions](https://redis.uptrace.dev/guide/go-redis-pipelines.html).
5858
- [Scripting](https://redis.uptrace.dev/guide/lua-scripting.html).
@@ -149,15 +149,40 @@ import (
149149
"github.com/redis/go-redis/v9"
150150
)
151151

152-
var ctx = context.Background()
153-
154-
func ExampleClient() {
155-
url := "redis://localhost:6379?password=hello&protocol=3"
152+
func ExampleClient() *redis.Client {
153+
url := "redis://user:password@localhost:6379/0?protocol=3"
156154
opts, err := redis.ParseURL(url)
157155
if err != nil {
158156
panic(err)
159157
}
160-
rdb := redis.NewClient(opts)
158+
159+
return redis.NewClient(opts)
160+
}
161+
162+
```
163+
164+
165+
### Advanced Configuration
166+
167+
go-redis supports extending the client identification phase to allow projects to send their own custom client identification.
168+
169+
#### Default Client Identification
170+
171+
By default, go-redis automatically sends the client library name and version during the connection process. This feature is available in redis-server as of version 7.2. As a result, the command is "fire and forget", meaning it should fail silently, in the case that the redis server does not support this feature.
172+
173+
#### Disabling Identity Verification
174+
175+
When connection identity verification is not required or needs to be explicitly disabled, a `DisableIndentity` configuration option exists. In V10 of this library, `DisableIndentity` will become `DisableIdentity` in order to fix the associated typo.
176+
177+
To disable verification, set the `DisableIndentity` option to `true` in the Redis client options:
178+
179+
```go
180+
rdb := redis.NewClient(&redis.Options{
181+
Addr: "localhost:6379",
182+
Password: "",
183+
DB: 0,
184+
DisableIndentity: true, // Disable set-info on connect
185+
})
161186
```
162187

163188
## Contributing

0 commit comments

Comments
 (0)