Skip to content

Commit 186376a

Browse files
authored
Merge branch 'master' into os-add-hash-field-expiration-commands
2 parents d1e68ab + f752b9a commit 186376a

File tree

20 files changed

+49
-39
lines changed

20 files changed

+49
-39
lines changed

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.1
8+
github.com/redis/go-redis/v9 v9.5.3
99
go.uber.org/zap v1.24.0
1010
)
1111

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
2-
github.com/bsm/ginkgo/v2 v2.7.0 h1:ItPMPH90RbmZJt5GtkcNvIRuGEdwlBItdNVoyzaNQao=
3-
github.com/bsm/gomega v1.26.0 h1:LhQm+AFcgV2M0WyKroMASzAzCAJVpAxQXv4SaI9a69Y=
2+
github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs=
3+
github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA=
44
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
55
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
66
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=

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.1
7+
require github.com/redis/go-redis/v9 v9.5.3
88

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

example/hll/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
github.com/bsm/ginkgo/v2 v2.7.0 h1:ItPMPH90RbmZJt5GtkcNvIRuGEdwlBItdNVoyzaNQao=
2-
github.com/bsm/gomega v1.26.0 h1:LhQm+AFcgV2M0WyKroMASzAzCAJVpAxQXv4SaI9a69Y=
1+
github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs=
2+
github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA=
33
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
44
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
55
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=

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.1
7+
require github.com/redis/go-redis/v9 v9.5.3
88

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

example/lua-scripting/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
github.com/bsm/ginkgo/v2 v2.7.0 h1:ItPMPH90RbmZJt5GtkcNvIRuGEdwlBItdNVoyzaNQao=
2-
github.com/bsm/gomega v1.26.0 h1:LhQm+AFcgV2M0WyKroMASzAzCAJVpAxQXv4SaI9a69Y=
1+
github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs=
2+
github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA=
33
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
44
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
55
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=

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.1
13-
github.com/redis/go-redis/v9 v9.5.1
12+
github.com/redis/go-redis/extra/redisotel/v9 v9.5.3
13+
github.com/redis/go-redis/v9 v9.5.3
1414
github.com/uptrace/uptrace-go v1.21.0
1515
go.opentelemetry.io/otel v1.22.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.1 // indirect
26+
github.com/redis/go-redis/extra/rediscmd/v9 v9.5.3 // indirect
2727
go.opentelemetry.io/contrib/instrumentation/runtime v0.46.1 // indirect
2828
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.44.0 // indirect
2929
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.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.1
7+
require github.com/redis/go-redis/v9 v9.5.3
88

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

example/redis-bloom/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
github.com/bsm/ginkgo/v2 v2.7.0 h1:ItPMPH90RbmZJt5GtkcNvIRuGEdwlBItdNVoyzaNQao=
2-
github.com/bsm/gomega v1.26.0 h1:LhQm+AFcgV2M0WyKroMASzAzCAJVpAxQXv4SaI9a69Y=
1+
github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs=
2+
github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA=
33
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
44
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
55
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=

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.1
9+
github.com/redis/go-redis/v9 v9.5.3
1010
)
1111

1212
require (

example/scan-struct/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
github.com/bsm/ginkgo/v2 v2.7.0 h1:ItPMPH90RbmZJt5GtkcNvIRuGEdwlBItdNVoyzaNQao=
2-
github.com/bsm/gomega v1.26.0 h1:LhQm+AFcgV2M0WyKroMASzAzCAJVpAxQXv4SaI9a69Y=
1+
github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs=
2+
github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA=
33
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
44
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
55
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=

extra/rediscensus/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ replace github.com/redis/go-redis/v9 => ../..
77
replace github.com/redis/go-redis/extra/rediscmd/v9 => ../rediscmd
88

99
require (
10-
github.com/redis/go-redis/extra/rediscmd/v9 v9.5.1
11-
github.com/redis/go-redis/v9 v9.5.1
10+
github.com/redis/go-redis/extra/rediscmd/v9 v9.5.3
11+
github.com/redis/go-redis/v9 v9.5.3
1212
go.opencensus.io v0.24.0
1313
)
1414

extra/rediscmd/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ replace github.com/redis/go-redis/v9 => ../..
77
require (
88
github.com/bsm/ginkgo/v2 v2.12.0
99
github.com/bsm/gomega v1.27.10
10-
github.com/redis/go-redis/v9 v9.5.1
10+
github.com/redis/go-redis/v9 v9.5.3
1111
)
1212

1313
require (

extra/redisotel/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ replace github.com/redis/go-redis/v9 => ../..
77
replace github.com/redis/go-redis/extra/rediscmd/v9 => ../rediscmd
88

99
require (
10-
github.com/redis/go-redis/extra/rediscmd/v9 v9.5.1
11-
github.com/redis/go-redis/v9 v9.5.1
10+
github.com/redis/go-redis/extra/rediscmd/v9 v9.5.3
11+
github.com/redis/go-redis/v9 v9.5.3
1212
go.opentelemetry.io/otel v1.22.0
1313
go.opentelemetry.io/otel/metric v1.22.0
1414
go.opentelemetry.io/otel/sdk v1.22.0

extra/redisprometheus/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/prometheus/client_golang v1.14.0
9-
github.com/redis/go-redis/v9 v9.5.1
9+
github.com/redis/go-redis/v9 v9.5.3
1010
)
1111

1212
require (

options.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ type Options struct {
6161
// before reconnecting. It should return the current username and password.
6262
CredentialsProvider func() (username string, password string)
6363

64+
// CredentialsProviderContext is an enhanced parameter of CredentialsProvider,
65+
// done to maintain API compatibility. In the future,
66+
// there might be a merge between CredentialsProviderContext and CredentialsProvider.
67+
// There will be a conflict between them; if CredentialsProviderContext exists, we will ignore CredentialsProvider.
68+
CredentialsProviderContext func(ctx context.Context) (username string, password string, err error)
69+
6470
// Database to be selected after connecting to the server.
6571
DB int
6672

osscluster.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,11 @@ type ClusterOptions struct {
6262

6363
OnConnect func(ctx context.Context, cn *Conn) error
6464

65-
Protocol int
66-
Username string
67-
Password string
68-
CredentialsProvider func() (username string, password string)
65+
Protocol int
66+
Username string
67+
Password string
68+
CredentialsProvider func() (username string, password string)
69+
CredentialsProviderContext func(ctx context.Context) (username string, password string, err error)
6970

7071
MaxRetries int
7172
MinRetryBackoff time.Duration
@@ -272,10 +273,11 @@ func (opt *ClusterOptions) clientOptions() *Options {
272273
Dialer: opt.Dialer,
273274
OnConnect: opt.OnConnect,
274275

275-
Protocol: opt.Protocol,
276-
Username: opt.Username,
277-
Password: opt.Password,
278-
CredentialsProvider: opt.CredentialsProvider,
276+
Protocol: opt.Protocol,
277+
Username: opt.Username,
278+
Password: opt.Password,
279+
CredentialsProvider: opt.CredentialsProvider,
280+
CredentialsProviderContext: opt.CredentialsProviderContext,
279281

280282
MaxRetries: opt.MaxRetries,
281283
MinRetryBackoff: opt.MinRetryBackoff,

redis.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,13 @@ func (c *baseClient) initConn(ctx context.Context, cn *pool.Conn) error {
283283
}
284284
cn.Inited = true
285285

286+
var err error
286287
username, password := c.opt.Username, c.opt.Password
287-
if c.opt.CredentialsProvider != nil {
288+
if c.opt.CredentialsProviderContext != nil {
289+
if username, password, err = c.opt.CredentialsProviderContext(ctx); err != nil {
290+
return err
291+
}
292+
} else if c.opt.CredentialsProvider != nil {
288293
username, password = c.opt.CredentialsProvider()
289294
}
290295

@@ -300,7 +305,7 @@ func (c *baseClient) initConn(ctx context.Context, cn *pool.Conn) error {
300305

301306
// for redis-server versions that do not support the HELLO command,
302307
// RESP2 will continue to be used.
303-
if err := conn.Hello(ctx, protocol, username, password, "").Err(); err == nil {
308+
if err = conn.Hello(ctx, protocol, username, password, "").Err(); err == nil {
304309
auth = true
305310
} else if !isRedisError(err) {
306311
// When the server responds with the RESP protocol and the result is not a normal
@@ -313,7 +318,7 @@ func (c *baseClient) initConn(ctx context.Context, cn *pool.Conn) error {
313318
return err
314319
}
315320

316-
_, err := conn.Pipelined(ctx, func(pipe Pipeliner) error {
321+
_, err = conn.Pipelined(ctx, func(pipe Pipeliner) error {
317322
if !auth && password != "" {
318323
if username != "" {
319324
pipe.AuthACL(ctx, username, password)

scripts/release.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ do
6060
done
6161

6262
sed --in-place "s/\(return \)\"[^\"]*\"/\1\"${TAG#v}\"/" ./version.go
63-
sed --in-place "s/\(\"version\": \)\"[^\"]*\"/\1\"${TAG#v}\"/" ./package.json
64-
65-
conventional-changelog -p angular -i CHANGELOG.md -s
6663

6764
git checkout -b release/${TAG} master
6865
git add -u

version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ package redis
22

33
// Version is the current release version.
44
func Version() string {
5-
return "9.5.1"
5+
return "9.5.3"
66
}

0 commit comments

Comments
 (0)