Skip to content

Commit 2837660

Browse files
authored
Merge branch 'master' into add-conn-pool-wait-stats
2 parents b1b84e7 + d43a9fa commit 2837660

File tree

18 files changed

+83
-28
lines changed

18 files changed

+83
-28
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

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,30 @@ func ExampleClient() *redis.Client {
161161

162162
```
163163

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+
})
186+
```
187+
164188
## Contributing
165189

166190
Please see [out contributing guidelines](CONTRIBUTING.md) to help us improve this library!

commands.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ func (c statefulCmdable) ClientSetInfo(ctx context.Context, info LibraryInfo) *S
309309

310310
var cmd *StatusCmd
311311
if info.LibName != nil {
312-
libName := fmt.Sprintf("go-redis(%s,%s)", *info.LibName, runtime.Version())
312+
libName := fmt.Sprintf("go-redis(%s,%s)", *info.LibName, internal.ReplaceSpaces(runtime.Version()))
313313
cmd = NewStatusCmd(ctx, "client", "setinfo", "LIB-NAME", libName)
314314
} else {
315315
cmd = NewStatusCmd(ctx, "client", "setinfo", "LIB-VER", *info.LibVer)

commands_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2105,7 +2105,7 @@ var _ = Describe("Commands", func() {
21052105

21062106
logEntries, err := client.ACLLog(ctx, 10).Result()
21072107
Expect(err).NotTo(HaveOccurred())
2108-
Expect(len(logEntries)).To(Equal(1))
2108+
Expect(len(logEntries)).To(Equal(4))
21092109

21102110
for _, entry := range logEntries {
21112111
Expect(entry.Reason).To(Equal("command"))
@@ -2121,7 +2121,7 @@ var _ = Describe("Commands", func() {
21212121

21222122
limitedLogEntries, err := client.ACLLog(ctx, 2).Result()
21232123
Expect(err).NotTo(HaveOccurred())
2124-
Expect(len(limitedLogEntries)).To(Equal(1))
2124+
Expect(len(limitedLogEntries)).To(Equal(2))
21252125
})
21262126

21272127
It("should ACL LOG RESET", Label("NonRedisEnterprise"), func() {

example/del-keys-without-ttl/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ go 1.18
55
replace github.com/redis/go-redis/v9 => ../..
66

77
require (
8-
github.com/redis/go-redis/v9 v9.5.0
8+
github.com/redis/go-redis/v9 v9.5.1
99
go.uber.org/zap v1.24.0
1010
)
1111

example/hll/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.18
44

55
replace github.com/redis/go-redis/v9 => ../..
66

7-
require github.com/redis/go-redis/v9 v9.5.0
7+
require github.com/redis/go-redis/v9 v9.5.1
88

99
require (
1010
github.com/cespare/xxhash/v2 v2.2.0 // indirect

example/lua-scripting/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.18
44

55
replace github.com/redis/go-redis/v9 => ../..
66

7-
require github.com/redis/go-redis/v9 v9.5.0
7+
require github.com/redis/go-redis/v9 v9.5.1
88

99
require (
1010
github.com/cespare/xxhash/v2 v2.2.0 // indirect

example/otel/go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ replace github.com/redis/go-redis/extra/redisotel/v9 => ../../extra/redisotel
99
replace github.com/redis/go-redis/extra/rediscmd/v9 => ../../extra/rediscmd
1010

1111
require (
12-
github.com/redis/go-redis/extra/redisotel/v9 v9.5.0
13-
github.com/redis/go-redis/v9 v9.5.0
12+
github.com/redis/go-redis/extra/redisotel/v9 v9.5.1
13+
github.com/redis/go-redis/v9 v9.5.1
1414
github.com/uptrace/uptrace-go v1.21.0
1515
go.opentelemetry.io/otel v1.21.0
1616
)
@@ -23,7 +23,7 @@ require (
2323
github.com/go-logr/stdr v1.2.2 // indirect
2424
github.com/golang/protobuf v1.5.3 // indirect
2525
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 // indirect
26-
github.com/redis/go-redis/extra/rediscmd/v9 v9.5.0 // indirect
26+
github.com/redis/go-redis/extra/rediscmd/v9 v9.5.1 // indirect
2727
go.opentelemetry.io/contrib/instrumentation/runtime v0.46.1 // indirect
2828
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.17.0 // indirect
2929
go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.43.0 // indirect

example/redis-bloom/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.18
44

55
replace github.com/redis/go-redis/v9 => ../..
66

7-
require github.com/redis/go-redis/v9 v9.5.0
7+
require github.com/redis/go-redis/v9 v9.5.1
88

99
require (
1010
github.com/cespare/xxhash/v2 v2.2.0 // indirect

example/scan-struct/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ replace github.com/redis/go-redis/v9 => ../..
66

77
require (
88
github.com/davecgh/go-spew v1.1.1
9-
github.com/redis/go-redis/v9 v9.5.0
9+
github.com/redis/go-redis/v9 v9.5.1
1010
)
1111

1212
require (

0 commit comments

Comments
 (0)