Bump github.com/redis/go-redis/v9 from 9.5.1 to 9.5.3
Bumps [github.com/redis/go-redis/v9](https://github.com/redis/go-redis) from 9.5.1 to 9.5.3. - [Release notes](https://github.com/redis/go-redis/releases) - [Changelog](https://github.com/redis/go-redis/blob/master/CHANGELOG.md) - [Commits](https://github.com/redis/go-redis/compare/v9.5.1...v9.5.3) --- updated-dependencies: - dependency-name: github.com/redis/go-redis/v9 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
parent
7d87dc30e4
commit
4606e103b2
16 changed files with 96 additions and 41 deletions
2
go.mod
2
go.mod
|
|
@ -17,7 +17,7 @@ require (
|
||||||
github.com/lib/pq v1.10.9
|
github.com/lib/pq v1.10.9
|
||||||
github.com/pkg/errors v0.9.1
|
github.com/pkg/errors v0.9.1
|
||||||
github.com/prometheus/client_golang v1.19.1
|
github.com/prometheus/client_golang v1.19.1
|
||||||
github.com/redis/go-redis/v9 v9.5.1
|
github.com/redis/go-redis/v9 v9.5.3
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
|
|
||||||
4
go.sum
4
go.sum
|
|
@ -122,8 +122,8 @@ github.com/prometheus/common v0.54.0 h1:ZlZy0BgJhTwVZUn7dLOkwCZHUkrAqd3WYtcFCWnM
|
||||||
github.com/prometheus/common v0.54.0/go.mod h1:/TQgMJP5CuVYveyT7n/0Ix8yLNNXy9yRSkhnLTHPDIQ=
|
github.com/prometheus/common v0.54.0/go.mod h1:/TQgMJP5CuVYveyT7n/0Ix8yLNNXy9yRSkhnLTHPDIQ=
|
||||||
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
|
github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc=
|
||||||
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
|
github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk=
|
||||||
github.com/redis/go-redis/v9 v9.5.1 h1:H1X4D3yHPaYrkL5X06Wh6xNVM/pX0Ft4RV0vMGvLBh8=
|
github.com/redis/go-redis/v9 v9.5.3 h1:fOAp1/uJG+ZtcITgZOfYFmTKPE7n4Vclj1wZFgRciUU=
|
||||||
github.com/redis/go-redis/v9 v9.5.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M=
|
github.com/redis/go-redis/v9 v9.5.3/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M=
|
||||||
github.com/rogpeppe/fastuuid v1.1.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
|
github.com/rogpeppe/fastuuid v1.1.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
|
||||||
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
|
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
|
||||||
github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM=
|
github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM=
|
||||||
|
|
|
||||||
9
vendor/github.com/redis/go-redis/v9/CHANGELOG.md
generated
vendored
9
vendor/github.com/redis/go-redis/v9/CHANGELOG.md
generated
vendored
|
|
@ -1,3 +1,12 @@
|
||||||
|
## Unreleased
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
* `go-redis` won't skip span creation if the parent spans is not recording. ([#2980](https://github.com/redis/go-redis/issues/2980))
|
||||||
|
Users can use the OpenTelemetry sampler to control the sampling behavior.
|
||||||
|
For instance, you can use the `ParentBased(NeverSample())` sampler from `go.opentelemetry.io/otel/sdk/trace` to keep
|
||||||
|
a similar behavior (drop orphan spans) of `go-redis` as before.
|
||||||
|
|
||||||
## [9.0.5](https://github.com/redis/go-redis/compare/v9.0.4...v9.0.5) (2023-05-29)
|
## [9.0.5](https://github.com/redis/go-redis/compare/v9.0.4...v9.0.5) (2023-05-29)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
5
vendor/github.com/redis/go-redis/v9/Makefile
generated
vendored
5
vendor/github.com/redis/go-redis/v9/Makefile
generated
vendored
|
|
@ -1,7 +1,12 @@
|
||||||
GO_MOD_DIRS := $(shell find . -type f -name 'go.mod' -exec dirname {} \; | sort)
|
GO_MOD_DIRS := $(shell find . -type f -name 'go.mod' -exec dirname {} \; | sort)
|
||||||
|
|
||||||
test: testdeps
|
test: testdeps
|
||||||
|
$(eval GO_VERSION := $(shell go version | cut -d " " -f 3 | cut -d. -f2))
|
||||||
set -e; for dir in $(GO_MOD_DIRS); do \
|
set -e; for dir in $(GO_MOD_DIRS); do \
|
||||||
|
if echo "$${dir}" | grep -q "./example" && [ "$(GO_VERSION)" = "19" ]; then \
|
||||||
|
echo "Skipping go test in $${dir} due to Go version 1.19 and dir contains ./example"; \
|
||||||
|
continue; \
|
||||||
|
fi; \
|
||||||
echo "go test in $${dir}"; \
|
echo "go test in $${dir}"; \
|
||||||
(cd "$${dir}" && \
|
(cd "$${dir}" && \
|
||||||
go mod tidy -compat=1.18 && \
|
go mod tidy -compat=1.18 && \
|
||||||
|
|
|
||||||
3
vendor/github.com/redis/go-redis/v9/README.md
generated
vendored
3
vendor/github.com/redis/go-redis/v9/README.md
generated
vendored
|
|
@ -143,9 +143,6 @@ to this specification.
|
||||||
|
|
||||||
```go
|
```go
|
||||||
import (
|
import (
|
||||||
"context"
|
|
||||||
"fmt"
|
|
||||||
|
|
||||||
"github.com/redis/go-redis/v9"
|
"github.com/redis/go-redis/v9"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
18
vendor/github.com/redis/go-redis/v9/bitmap_commands.go
generated
vendored
18
vendor/github.com/redis/go-redis/v9/bitmap_commands.go
generated
vendored
|
|
@ -16,6 +16,7 @@ type BitMapCmdable interface {
|
||||||
BitPos(ctx context.Context, key string, bit int64, pos ...int64) *IntCmd
|
BitPos(ctx context.Context, key string, bit int64, pos ...int64) *IntCmd
|
||||||
BitPosSpan(ctx context.Context, key string, bit int8, start, end int64, span string) *IntCmd
|
BitPosSpan(ctx context.Context, key string, bit int8, start, end int64, span string) *IntCmd
|
||||||
BitField(ctx context.Context, key string, values ...interface{}) *IntSliceCmd
|
BitField(ctx context.Context, key string, values ...interface{}) *IntSliceCmd
|
||||||
|
BitFieldRO(ctx context.Context, key string, values ...interface{}) *IntSliceCmd
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c cmdable) GetBit(ctx context.Context, key string, offset int64) *IntCmd {
|
func (c cmdable) GetBit(ctx context.Context, key string, offset int64) *IntCmd {
|
||||||
|
|
@ -45,22 +46,19 @@ const BitCountIndexByte string = "BYTE"
|
||||||
const BitCountIndexBit string = "BIT"
|
const BitCountIndexBit string = "BIT"
|
||||||
|
|
||||||
func (c cmdable) BitCount(ctx context.Context, key string, bitCount *BitCount) *IntCmd {
|
func (c cmdable) BitCount(ctx context.Context, key string, bitCount *BitCount) *IntCmd {
|
||||||
args := []interface{}{"bitcount", key}
|
args := make([]any, 2, 5)
|
||||||
|
args[0] = "bitcount"
|
||||||
|
args[1] = key
|
||||||
if bitCount != nil {
|
if bitCount != nil {
|
||||||
if bitCount.Unit == "" {
|
args = append(args, bitCount.Start, bitCount.End)
|
||||||
bitCount.Unit = "BYTE"
|
if bitCount.Unit != "" {
|
||||||
}
|
|
||||||
if bitCount.Unit != BitCountIndexByte && bitCount.Unit != BitCountIndexBit {
|
if bitCount.Unit != BitCountIndexByte && bitCount.Unit != BitCountIndexBit {
|
||||||
cmd := NewIntCmd(ctx)
|
cmd := NewIntCmd(ctx)
|
||||||
cmd.SetErr(errors.New("redis: invalid bitcount index"))
|
cmd.SetErr(errors.New("redis: invalid bitcount index"))
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
args = append(
|
args = append(args, bitCount.Unit)
|
||||||
args,
|
}
|
||||||
bitCount.Start,
|
|
||||||
bitCount.End,
|
|
||||||
string(bitCount.Unit),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
cmd := NewIntCmd(ctx, args...)
|
cmd := NewIntCmd(ctx, args...)
|
||||||
_ = c(ctx, cmd)
|
_ = c(ctx, cmd)
|
||||||
|
|
|
||||||
5
vendor/github.com/redis/go-redis/v9/command.go
generated
vendored
5
vendor/github.com/redis/go-redis/v9/command.go
generated
vendored
|
|
@ -5454,9 +5454,12 @@ func (cmd *MonitorCmd) readMonitor(rd *proto.Reader, cancel context.CancelFunc)
|
||||||
for {
|
for {
|
||||||
cmd.mu.Lock()
|
cmd.mu.Lock()
|
||||||
st := cmd.status
|
st := cmd.status
|
||||||
|
pk, _ := rd.Peek(1)
|
||||||
cmd.mu.Unlock()
|
cmd.mu.Unlock()
|
||||||
if pk, _ := rd.Peek(1); len(pk) != 0 && st == monitorStatusStart {
|
if len(pk) != 0 && st == monitorStatusStart {
|
||||||
|
cmd.mu.Lock()
|
||||||
line, err := rd.ReadString()
|
line, err := rd.ReadString()
|
||||||
|
cmd.mu.Unlock()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
3
vendor/github.com/redis/go-redis/v9/error.go
generated
vendored
3
vendor/github.com/redis/go-redis/v9/error.go
generated
vendored
|
|
@ -7,6 +7,7 @@ import (
|
||||||
"net"
|
"net"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/redis/go-redis/v9/internal"
|
||||||
"github.com/redis/go-redis/v9/internal/pool"
|
"github.com/redis/go-redis/v9/internal/pool"
|
||||||
"github.com/redis/go-redis/v9/internal/proto"
|
"github.com/redis/go-redis/v9/internal/proto"
|
||||||
)
|
)
|
||||||
|
|
@ -129,7 +130,9 @@ func isMovedError(err error) (moved bool, ask bool, addr string) {
|
||||||
if ind == -1 {
|
if ind == -1 {
|
||||||
return false, false, ""
|
return false, false, ""
|
||||||
}
|
}
|
||||||
|
|
||||||
addr = s[ind+1:]
|
addr = s[ind+1:]
|
||||||
|
addr = internal.GetAddr(addr)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
17
vendor/github.com/redis/go-redis/v9/internal/util.go
generated
vendored
17
vendor/github.com/redis/go-redis/v9/internal/util.go
generated
vendored
|
|
@ -2,6 +2,7 @@ package internal
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"net"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
|
@ -64,3 +65,19 @@ func ReplaceSpaces(s string) string {
|
||||||
|
|
||||||
return builder.String()
|
return builder.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetAddr(addr string) string {
|
||||||
|
ind := strings.LastIndexByte(addr, ':')
|
||||||
|
if ind == -1 {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
if strings.IndexByte(addr, '.') != -1 {
|
||||||
|
return addr
|
||||||
|
}
|
||||||
|
|
||||||
|
if addr[0] == '[' {
|
||||||
|
return addr
|
||||||
|
}
|
||||||
|
return net.JoinHostPort(addr[:ind], addr[ind+1:])
|
||||||
|
}
|
||||||
|
|
|
||||||
12
vendor/github.com/redis/go-redis/v9/options.go
generated
vendored
12
vendor/github.com/redis/go-redis/v9/options.go
generated
vendored
|
|
@ -61,6 +61,12 @@ type Options struct {
|
||||||
// before reconnecting. It should return the current username and password.
|
// before reconnecting. It should return the current username and password.
|
||||||
CredentialsProvider func() (username string, password string)
|
CredentialsProvider func() (username string, password string)
|
||||||
|
|
||||||
|
// CredentialsProviderContext is an enhanced parameter of CredentialsProvider,
|
||||||
|
// done to maintain API compatibility. In the future,
|
||||||
|
// there might be a merge between CredentialsProviderContext and CredentialsProvider.
|
||||||
|
// There will be a conflict between them; if CredentialsProviderContext exists, we will ignore CredentialsProvider.
|
||||||
|
CredentialsProviderContext func(ctx context.Context) (username string, password string, err error)
|
||||||
|
|
||||||
// Database to be selected after connecting to the server.
|
// Database to be selected after connecting to the server.
|
||||||
DB int
|
DB int
|
||||||
|
|
||||||
|
|
@ -235,7 +241,7 @@ func NewDialer(opt *Options) func(context.Context, string, string) (net.Conn, er
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ParseURL parses an URL into Options that can be used to connect to Redis.
|
// ParseURL parses a URL into Options that can be used to connect to Redis.
|
||||||
// Scheme is required.
|
// Scheme is required.
|
||||||
// There are two connection types: by tcp socket and by unix socket.
|
// There are two connection types: by tcp socket and by unix socket.
|
||||||
// Tcp connection:
|
// Tcp connection:
|
||||||
|
|
@ -250,12 +256,12 @@ func NewDialer(opt *Options) func(context.Context, string, string) (net.Conn, er
|
||||||
// - field names are mapped using snake-case conversion: to set MaxRetries, use max_retries
|
// - field names are mapped using snake-case conversion: to set MaxRetries, use max_retries
|
||||||
// - only scalar type fields are supported (bool, int, time.Duration)
|
// - only scalar type fields are supported (bool, int, time.Duration)
|
||||||
// - for time.Duration fields, values must be a valid input for time.ParseDuration();
|
// - for time.Duration fields, values must be a valid input for time.ParseDuration();
|
||||||
// additionally a plain integer as value (i.e. without unit) is intepreted as seconds
|
// additionally a plain integer as value (i.e. without unit) is interpreted as seconds
|
||||||
// - to disable a duration field, use value less than or equal to 0; to use the default
|
// - to disable a duration field, use value less than or equal to 0; to use the default
|
||||||
// value, leave the value blank or remove the parameter
|
// value, leave the value blank or remove the parameter
|
||||||
// - only the last value is interpreted if a parameter is given multiple times
|
// - only the last value is interpreted if a parameter is given multiple times
|
||||||
// - fields "network", "addr", "username" and "password" can only be set using other
|
// - fields "network", "addr", "username" and "password" can only be set using other
|
||||||
// URL attributes (scheme, host, userinfo, resp.), query paremeters using these
|
// URL attributes (scheme, host, userinfo, resp.), query parameters using these
|
||||||
// names will be treated as unknown parameters
|
// names will be treated as unknown parameters
|
||||||
// - unknown parameter names will result in an error
|
// - unknown parameter names will result in an error
|
||||||
//
|
//
|
||||||
|
|
|
||||||
12
vendor/github.com/redis/go-redis/v9/osscluster.go
generated
vendored
12
vendor/github.com/redis/go-redis/v9/osscluster.go
generated
vendored
|
|
@ -66,6 +66,7 @@ type ClusterOptions struct {
|
||||||
Username string
|
Username string
|
||||||
Password string
|
Password string
|
||||||
CredentialsProvider func() (username string, password string)
|
CredentialsProvider func() (username string, password string)
|
||||||
|
CredentialsProviderContext func(ctx context.Context) (username string, password string, err error)
|
||||||
|
|
||||||
MaxRetries int
|
MaxRetries int
|
||||||
MinRetryBackoff time.Duration
|
MinRetryBackoff time.Duration
|
||||||
|
|
@ -157,12 +158,12 @@ func (opt *ClusterOptions) init() {
|
||||||
// - field names are mapped using snake-case conversion: to set MaxRetries, use max_retries
|
// - field names are mapped using snake-case conversion: to set MaxRetries, use max_retries
|
||||||
// - only scalar type fields are supported (bool, int, time.Duration)
|
// - only scalar type fields are supported (bool, int, time.Duration)
|
||||||
// - for time.Duration fields, values must be a valid input for time.ParseDuration();
|
// - for time.Duration fields, values must be a valid input for time.ParseDuration();
|
||||||
// additionally a plain integer as value (i.e. without unit) is intepreted as seconds
|
// additionally a plain integer as value (i.e. without unit) is interpreted as seconds
|
||||||
// - to disable a duration field, use value less than or equal to 0; to use the default
|
// - to disable a duration field, use value less than or equal to 0; to use the default
|
||||||
// value, leave the value blank or remove the parameter
|
// value, leave the value blank or remove the parameter
|
||||||
// - only the last value is interpreted if a parameter is given multiple times
|
// - only the last value is interpreted if a parameter is given multiple times
|
||||||
// - fields "network", "addr", "username" and "password" can only be set using other
|
// - fields "network", "addr", "username" and "password" can only be set using other
|
||||||
// URL attributes (scheme, host, userinfo, resp.), query paremeters using these
|
// URL attributes (scheme, host, userinfo, resp.), query parameters using these
|
||||||
// names will be treated as unknown parameters
|
// names will be treated as unknown parameters
|
||||||
// - unknown parameter names will result in an error
|
// - unknown parameter names will result in an error
|
||||||
//
|
//
|
||||||
|
|
@ -276,6 +277,7 @@ func (opt *ClusterOptions) clientOptions() *Options {
|
||||||
Username: opt.Username,
|
Username: opt.Username,
|
||||||
Password: opt.Password,
|
Password: opt.Password,
|
||||||
CredentialsProvider: opt.CredentialsProvider,
|
CredentialsProvider: opt.CredentialsProvider,
|
||||||
|
CredentialsProviderContext: opt.CredentialsProviderContext,
|
||||||
|
|
||||||
MaxRetries: opt.MaxRetries,
|
MaxRetries: opt.MaxRetries,
|
||||||
MinRetryBackoff: opt.MinRetryBackoff,
|
MinRetryBackoff: opt.MinRetryBackoff,
|
||||||
|
|
@ -1295,6 +1297,7 @@ func (c *ClusterClient) processPipelineNode(
|
||||||
_ = node.Client.withProcessPipelineHook(ctx, cmds, func(ctx context.Context, cmds []Cmder) error {
|
_ = node.Client.withProcessPipelineHook(ctx, cmds, func(ctx context.Context, cmds []Cmder) error {
|
||||||
cn, err := node.Client.getConn(ctx)
|
cn, err := node.Client.getConn(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
node.MarkAsFailing()
|
||||||
_ = c.mapCmdsByNode(ctx, failedCmds, cmds)
|
_ = c.mapCmdsByNode(ctx, failedCmds, cmds)
|
||||||
setCmdsErr(cmds, err)
|
setCmdsErr(cmds, err)
|
||||||
return err
|
return err
|
||||||
|
|
@ -1316,6 +1319,9 @@ func (c *ClusterClient) processPipelineNodeConn(
|
||||||
if err := cn.WithWriter(c.context(ctx), c.opt.WriteTimeout, func(wr *proto.Writer) error {
|
if err := cn.WithWriter(c.context(ctx), c.opt.WriteTimeout, func(wr *proto.Writer) error {
|
||||||
return writeCmds(wr, cmds)
|
return writeCmds(wr, cmds)
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
|
if isBadConn(err, false, node.Client.getAddr()) {
|
||||||
|
node.MarkAsFailing()
|
||||||
|
}
|
||||||
if shouldRetry(err, true) {
|
if shouldRetry(err, true) {
|
||||||
_ = c.mapCmdsByNode(ctx, failedCmds, cmds)
|
_ = c.mapCmdsByNode(ctx, failedCmds, cmds)
|
||||||
}
|
}
|
||||||
|
|
@ -1347,7 +1353,7 @@ func (c *ClusterClient) pipelineReadCmds(
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.opt.ReadOnly {
|
if c.opt.ReadOnly && isBadConn(err, false, node.Client.getAddr()) {
|
||||||
node.MarkAsFailing()
|
node.MarkAsFailing()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
2
vendor/github.com/redis/go-redis/v9/pubsub.go
generated
vendored
2
vendor/github.com/redis/go-redis/v9/pubsub.go
generated
vendored
|
|
@ -491,7 +491,7 @@ func (c *PubSub) getContext() context.Context {
|
||||||
// Receive* APIs can not be used after channel is created.
|
// Receive* APIs can not be used after channel is created.
|
||||||
//
|
//
|
||||||
// go-redis periodically sends ping messages to test connection health
|
// go-redis periodically sends ping messages to test connection health
|
||||||
// and re-subscribes if ping can not not received for 1 minute.
|
// and re-subscribes if ping can not received for 1 minute.
|
||||||
func (c *PubSub) Channel(opts ...ChannelOption) <-chan *Message {
|
func (c *PubSub) Channel(opts ...ChannelOption) <-chan *Message {
|
||||||
c.chOnce.Do(func() {
|
c.chOnce.Do(func() {
|
||||||
c.msgCh = newChannel(c, opts...)
|
c.msgCh = newChannel(c, opts...)
|
||||||
|
|
|
||||||
11
vendor/github.com/redis/go-redis/v9/redis.go
generated
vendored
11
vendor/github.com/redis/go-redis/v9/redis.go
generated
vendored
|
|
@ -283,8 +283,13 @@ func (c *baseClient) initConn(ctx context.Context, cn *pool.Conn) error {
|
||||||
}
|
}
|
||||||
cn.Inited = true
|
cn.Inited = true
|
||||||
|
|
||||||
|
var err error
|
||||||
username, password := c.opt.Username, c.opt.Password
|
username, password := c.opt.Username, c.opt.Password
|
||||||
if c.opt.CredentialsProvider != nil {
|
if c.opt.CredentialsProviderContext != nil {
|
||||||
|
if username, password, err = c.opt.CredentialsProviderContext(ctx); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
} else if c.opt.CredentialsProvider != nil {
|
||||||
username, password = c.opt.CredentialsProvider()
|
username, password = c.opt.CredentialsProvider()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -300,7 +305,7 @@ func (c *baseClient) initConn(ctx context.Context, cn *pool.Conn) error {
|
||||||
|
|
||||||
// for redis-server versions that do not support the HELLO command,
|
// for redis-server versions that do not support the HELLO command,
|
||||||
// RESP2 will continue to be used.
|
// RESP2 will continue to be used.
|
||||||
if err := conn.Hello(ctx, protocol, username, password, "").Err(); err == nil {
|
if err = conn.Hello(ctx, protocol, username, password, "").Err(); err == nil {
|
||||||
auth = true
|
auth = true
|
||||||
} else if !isRedisError(err) {
|
} else if !isRedisError(err) {
|
||||||
// When the server responds with the RESP protocol and the result is not a normal
|
// 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 {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err := conn.Pipelined(ctx, func(pipe Pipeliner) error {
|
_, err = conn.Pipelined(ctx, func(pipe Pipeliner) error {
|
||||||
if !auth && password != "" {
|
if !auth && password != "" {
|
||||||
if username != "" {
|
if username != "" {
|
||||||
pipe.AuthACL(ctx, username, password)
|
pipe.AuthACL(ctx, username, password)
|
||||||
|
|
|
||||||
6
vendor/github.com/redis/go-redis/v9/stream_commands.go
generated
vendored
6
vendor/github.com/redis/go-redis/v9/stream_commands.go
generated
vendored
|
|
@ -178,36 +178,42 @@ func (c cmdable) XReadStreams(ctx context.Context, streams ...string) *XStreamSl
|
||||||
|
|
||||||
func (c cmdable) XGroupCreate(ctx context.Context, stream, group, start string) *StatusCmd {
|
func (c cmdable) XGroupCreate(ctx context.Context, stream, group, start string) *StatusCmd {
|
||||||
cmd := NewStatusCmd(ctx, "xgroup", "create", stream, group, start)
|
cmd := NewStatusCmd(ctx, "xgroup", "create", stream, group, start)
|
||||||
|
cmd.SetFirstKeyPos(2)
|
||||||
_ = c(ctx, cmd)
|
_ = c(ctx, cmd)
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c cmdable) XGroupCreateMkStream(ctx context.Context, stream, group, start string) *StatusCmd {
|
func (c cmdable) XGroupCreateMkStream(ctx context.Context, stream, group, start string) *StatusCmd {
|
||||||
cmd := NewStatusCmd(ctx, "xgroup", "create", stream, group, start, "mkstream")
|
cmd := NewStatusCmd(ctx, "xgroup", "create", stream, group, start, "mkstream")
|
||||||
|
cmd.SetFirstKeyPos(2)
|
||||||
_ = c(ctx, cmd)
|
_ = c(ctx, cmd)
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c cmdable) XGroupSetID(ctx context.Context, stream, group, start string) *StatusCmd {
|
func (c cmdable) XGroupSetID(ctx context.Context, stream, group, start string) *StatusCmd {
|
||||||
cmd := NewStatusCmd(ctx, "xgroup", "setid", stream, group, start)
|
cmd := NewStatusCmd(ctx, "xgroup", "setid", stream, group, start)
|
||||||
|
cmd.SetFirstKeyPos(2)
|
||||||
_ = c(ctx, cmd)
|
_ = c(ctx, cmd)
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c cmdable) XGroupDestroy(ctx context.Context, stream, group string) *IntCmd {
|
func (c cmdable) XGroupDestroy(ctx context.Context, stream, group string) *IntCmd {
|
||||||
cmd := NewIntCmd(ctx, "xgroup", "destroy", stream, group)
|
cmd := NewIntCmd(ctx, "xgroup", "destroy", stream, group)
|
||||||
|
cmd.SetFirstKeyPos(2)
|
||||||
_ = c(ctx, cmd)
|
_ = c(ctx, cmd)
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c cmdable) XGroupCreateConsumer(ctx context.Context, stream, group, consumer string) *IntCmd {
|
func (c cmdable) XGroupCreateConsumer(ctx context.Context, stream, group, consumer string) *IntCmd {
|
||||||
cmd := NewIntCmd(ctx, "xgroup", "createconsumer", stream, group, consumer)
|
cmd := NewIntCmd(ctx, "xgroup", "createconsumer", stream, group, consumer)
|
||||||
|
cmd.SetFirstKeyPos(2)
|
||||||
_ = c(ctx, cmd)
|
_ = c(ctx, cmd)
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c cmdable) XGroupDelConsumer(ctx context.Context, stream, group, consumer string) *IntCmd {
|
func (c cmdable) XGroupDelConsumer(ctx context.Context, stream, group, consumer string) *IntCmd {
|
||||||
cmd := NewIntCmd(ctx, "xgroup", "delconsumer", stream, group, consumer)
|
cmd := NewIntCmd(ctx, "xgroup", "delconsumer", stream, group, consumer)
|
||||||
|
cmd.SetFirstKeyPos(2)
|
||||||
_ = c(ctx, cmd)
|
_ = c(ctx, cmd)
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2
vendor/github.com/redis/go-redis/v9/version.go
generated
vendored
2
vendor/github.com/redis/go-redis/v9/version.go
generated
vendored
|
|
@ -2,5 +2,5 @@ package redis
|
||||||
|
|
||||||
// Version is the current release version.
|
// Version is the current release version.
|
||||||
func Version() string {
|
func Version() string {
|
||||||
return "9.5.1"
|
return "9.5.3"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
|
|
@ -191,7 +191,7 @@ github.com/prometheus/common/model
|
||||||
github.com/prometheus/procfs
|
github.com/prometheus/procfs
|
||||||
github.com/prometheus/procfs/internal/fs
|
github.com/prometheus/procfs/internal/fs
|
||||||
github.com/prometheus/procfs/internal/util
|
github.com/prometheus/procfs/internal/util
|
||||||
# github.com/redis/go-redis/v9 v9.5.1
|
# github.com/redis/go-redis/v9 v9.5.3
|
||||||
## explicit; go 1.18
|
## explicit; go 1.18
|
||||||
github.com/redis/go-redis/v9
|
github.com/redis/go-redis/v9
|
||||||
github.com/redis/go-redis/v9/internal
|
github.com/redis/go-redis/v9/internal
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue