diff --git a/go.mod b/go.mod index 32363b994..cdbaac47f 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/go-graphite/gocairo v0.1.0 github.com/go-graphite/protocol v1.0.0 github.com/golang/protobuf v1.5.4 - github.com/gomodule/redigo v1.9.2 + github.com/gomodule/redigo v1.9.3 github.com/gorilla/handlers v1.5.2 github.com/lib/pq v1.10.9 github.com/lomik/og-rek v0.0.0-20170411191824-628eefeb8d80 diff --git a/go.sum b/go.sum index d0445f0fa..df2254816 100644 --- a/go.sum +++ b/go.sum @@ -78,8 +78,8 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomodule/redigo v1.9.2 h1:HrutZBLhSIU8abiSfW8pj8mPhOyMYjZT/wcA4/L9L9s= -github.com/gomodule/redigo v1.9.2/go.mod h1:KsU3hiK/Ay8U42qpaJk+kuNa3C+spxapWpM+ywhcgtw= +github.com/gomodule/redigo v1.9.3 h1:dNPSXeXv6HCq2jdyWfjgmhBdqnR6PRO3m/G05nvpPC8= +github.com/gomodule/redigo v1.9.3/go.mod h1:KsU3hiK/Ay8U42qpaJk+kuNa3C+spxapWpM+ywhcgtw= github.com/google/flatbuffers v24.3.25+incompatible h1:CX395cjN9Kke9mmalRoL3d81AtFUxJM+yDthflgJGkI= github.com/google/flatbuffers v24.3.25+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= diff --git a/vendor/github.com/gomodule/redigo/redis/conn.go b/vendor/github.com/gomodule/redigo/redis/conn.go index 753644b1b..dc445a066 100644 --- a/vendor/github.com/gomodule/redigo/redis/conn.go +++ b/vendor/github.com/gomodule/redigo/redis/conn.go @@ -332,7 +332,10 @@ func DialURLContext(ctx context.Context, rawurl string, options ...DialOption) ( return nil, err } - if u.Scheme != "redis" && u.Scheme != "rediss" { + switch u.Scheme { + case "redis", "rediss", "valkey", "valkeys": + // valid scheme + default: return nil, fmt.Errorf("invalid redis URL scheme: %s", u.Scheme) } @@ -386,7 +389,7 @@ func DialURLContext(ctx context.Context, rawurl string, options ...DialOption) ( return nil, fmt.Errorf("invalid database: %s", u.Path[1:]) } - options = append(options, DialUseTLS(u.Scheme == "rediss")) + options = append(options, DialUseTLS(u.Scheme == "rediss" || u.Scheme == "valkeys")) return DialContext(ctx, "tcp", address, options...) } diff --git a/vendor/github.com/gomodule/redigo/redis/scan.go b/vendor/github.com/gomodule/redigo/redis/scan.go index 82121011b..c1fb800d1 100644 --- a/vendor/github.com/gomodule/redigo/redis/scan.go +++ b/vendor/github.com/gomodule/redigo/redis/scan.go @@ -477,7 +477,7 @@ var errScanStructValue = errors.New("redigo.ScanStruct: value must be non-nil po // ScanStruct uses exported field names to match values in the response. Use // 'redis' field tag to override the name: // -// Field int `redis:"myName"` +// Field int `redis:"myName"` // // Fields with the tag redis:"-" are ignored. // @@ -513,9 +513,9 @@ func ScanStruct(src []interface{}, dest interface{}) error { continue } - name, ok := src[i].([]byte) + name, ok := convertToBulk(src[i]) if !ok { - return fmt.Errorf("redigo.ScanStruct: key %d not a bulk string value", i) + return fmt.Errorf("redigo.ScanStruct: key %d not a bulk string value got type: %T", i, src[i]) } fs := ss.fieldSpec(name) @@ -530,6 +530,19 @@ func ScanStruct(src []interface{}, dest interface{}) error { return nil } +// convertToBulk converts src to a []byte if src is a string or bulk string +// and returns true. Otherwise nil and false is returned. +func convertToBulk(src interface{}) ([]byte, bool) { + switch v := src.(type) { + case []byte: + return v, true + case string: + return []byte(v), true + default: + return nil, false + } +} + var ( errScanSliceValue = errors.New("redigo.ScanSlice: dest must be non-nil pointer to a struct") ) diff --git a/vendor/modules.txt b/vendor/modules.txt index aa6f0ffa0..2de7554f8 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -78,7 +78,7 @@ github.com/gogo/protobuf/sortkeys # github.com/golang/protobuf v1.5.4 ## explicit; go 1.17 github.com/golang/protobuf/ptypes/empty -# github.com/gomodule/redigo v1.9.2 +# github.com/gomodule/redigo v1.9.3 ## explicit; go 1.17 github.com/gomodule/redigo/redis # github.com/google/flatbuffers v24.3.25+incompatible