forked from mirror/redis
fix repo
This commit is contained in:
parent
52af8ba852
commit
a337be9066
10
README.md
10
README.md
|
@ -1,7 +1,7 @@
|
||||||
# Redis client for Go
|
# Redis client for Go
|
||||||
|
|
||||||
![build workflow](https://github.com/go-redis/redis/actions/workflows/build.yml/badge.svg)
|
![build workflow](https://github.com/go-redis/redis/actions/workflows/build.yml/badge.svg)
|
||||||
[![PkgGoDev](https://pkg.go.dev/badge/github.com/go-redis/redis/v8)](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc)
|
[![PkgGoDev](https://pkg.go.dev/badge/git.internal/re/redis/v8)](https://pkg.go.dev/git.internal/re/redis/v8?tab=doc)
|
||||||
[![Documentation](https://img.shields.io/badge/redis-documentation-informational)](https://redis.uptrace.dev/)
|
[![Documentation](https://img.shields.io/badge/redis-documentation-informational)](https://redis.uptrace.dev/)
|
||||||
[![Chat](https://discordapp.com/api/guilds/752070105847955518/widget.png)](https://discord.gg/rWtp5Aj)
|
[![Chat](https://discordapp.com/api/guilds/752070105847955518/widget.png)](https://discord.gg/rWtp5Aj)
|
||||||
|
|
||||||
|
@ -28,8 +28,8 @@ for your applications thanks to its per request pricing and low latency data.
|
||||||
- [Documentation](https://redis.uptrace.dev)
|
- [Documentation](https://redis.uptrace.dev)
|
||||||
- [Discussions](https://github.com/go-redis/redis/discussions)
|
- [Discussions](https://github.com/go-redis/redis/discussions)
|
||||||
- [Chat](https://discord.gg/rWtp5Aj)
|
- [Chat](https://discord.gg/rWtp5Aj)
|
||||||
- [Reference](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc)
|
- [Reference](https://pkg.go.dev/git.internal/re/redis/v8?tab=doc)
|
||||||
- [Examples](https://pkg.go.dev/github.com/go-redis/redis/v8?tab=doc#pkg-examples)
|
- [Examples](https://pkg.go.dev/git.internal/re/redis/v8?tab=doc#pkg-examples)
|
||||||
|
|
||||||
## Ecosystem
|
## Ecosystem
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ go mod init github.com/my/repo
|
||||||
And then install go-redis/v8 (note _v8_ in the import; omitting it is a popular mistake):
|
And then install go-redis/v8 (note _v8_ in the import; omitting it is a popular mistake):
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
go get github.com/go-redis/redis/v8
|
go get git.internal/re/redis/v8
|
||||||
```
|
```
|
||||||
|
|
||||||
## Quickstart
|
## Quickstart
|
||||||
|
@ -74,7 +74,7 @@ go get github.com/go-redis/redis/v8
|
||||||
```go
|
```go
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"github.com/go-redis/redis/v8"
|
"git.internal/re/redis/v8"
|
||||||
"fmt"
|
"fmt"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8/internal/proto"
|
"git.internal/re/redis/v8/internal/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ctx = context.TODO()
|
var ctx = context.TODO()
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8"
|
"git.internal/re/redis/v8"
|
||||||
)
|
)
|
||||||
|
|
||||||
func benchmarkRedisClient(ctx context.Context, poolSize int) *redis.Client {
|
func benchmarkRedisClient(ctx context.Context, poolSize int) *redis.Client {
|
||||||
|
|
10
cluster.go
10
cluster.go
|
@ -12,11 +12,11 @@ import (
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8/internal"
|
"git.internal/re/redis/v8/internal"
|
||||||
"github.com/go-redis/redis/v8/internal/hashtag"
|
"git.internal/re/redis/v8/internal/hashtag"
|
||||||
"github.com/go-redis/redis/v8/internal/pool"
|
"git.internal/re/redis/v8/internal/pool"
|
||||||
"github.com/go-redis/redis/v8/internal/proto"
|
"git.internal/re/redis/v8/internal/proto"
|
||||||
"github.com/go-redis/redis/v8/internal/rand"
|
"git.internal/re/redis/v8/internal/rand"
|
||||||
)
|
)
|
||||||
|
|
||||||
var errClusterNoNodes = fmt.Errorf("redis: cluster has no nodes")
|
var errClusterNoNodes = fmt.Errorf("redis: cluster has no nodes")
|
||||||
|
|
|
@ -12,8 +12,8 @@ import (
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8"
|
"git.internal/re/redis/v8"
|
||||||
"github.com/go-redis/redis/v8/internal/hashtag"
|
"git.internal/re/redis/v8/internal/hashtag"
|
||||||
)
|
)
|
||||||
|
|
||||||
type clusterScenario struct {
|
type clusterScenario struct {
|
||||||
|
|
|
@ -7,10 +7,10 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8/internal"
|
"git.internal/re/redis/v8/internal"
|
||||||
"github.com/go-redis/redis/v8/internal/hscan"
|
"git.internal/re/redis/v8/internal/hscan"
|
||||||
"github.com/go-redis/redis/v8/internal/proto"
|
"git.internal/re/redis/v8/internal/proto"
|
||||||
"github.com/go-redis/redis/v8/internal/util"
|
"git.internal/re/redis/v8/internal/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Cmder interface {
|
type Cmder interface {
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
|
||||||
redis "github.com/go-redis/redis/v8"
|
redis "git.internal/re/redis/v8"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = Describe("Cmd", func() {
|
var _ = Describe("Cmd", func() {
|
||||||
|
|
30
commands.go
30
commands.go
|
@ -6,14 +6,14 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8/internal"
|
"git.internal/re/redis/v8/internal"
|
||||||
)
|
)
|
||||||
|
|
||||||
// KeepTTL is a Redis KEEPTTL option to keep existing TTL, it requires your redis-server version >= 6.0,
|
// KeepTTL is a Redis KEEPTTL option to keep existing TTL, it requires your redis-server version >= 6.0,
|
||||||
// otherwise you will receive an error: (error) ERR syntax error.
|
// otherwise you will receive an error: (error) ERR syntax error.
|
||||||
// For example:
|
// For example:
|
||||||
//
|
//
|
||||||
// rdb.Set(ctx, key, value, redis.KeepTTL)
|
// rdb.Set(ctx, key, value, redis.KeepTTL)
|
||||||
const KeepTTL = -1
|
const KeepTTL = -1
|
||||||
|
|
||||||
func usePrecise(dur time.Duration) bool {
|
func usePrecise(dur time.Duration) bool {
|
||||||
|
@ -2049,8 +2049,10 @@ func xClaimArgs(a *XClaimArgs) []interface{} {
|
||||||
|
|
||||||
// xTrim If approx is true, add the "~" parameter, otherwise it is the default "=" (redis default).
|
// xTrim If approx is true, add the "~" parameter, otherwise it is the default "=" (redis default).
|
||||||
// example:
|
// example:
|
||||||
// XTRIM key MAXLEN/MINID threshold LIMIT limit.
|
//
|
||||||
// XTRIM key MAXLEN/MINID ~ threshold LIMIT limit.
|
// XTRIM key MAXLEN/MINID threshold LIMIT limit.
|
||||||
|
// XTRIM key MAXLEN/MINID ~ threshold LIMIT limit.
|
||||||
|
//
|
||||||
// The redis-server version is lower than 6.2, please set limit to 0.
|
// The redis-server version is lower than 6.2, please set limit to 0.
|
||||||
func (c cmdable) xTrim(
|
func (c cmdable) xTrim(
|
||||||
ctx context.Context, key, strategy string,
|
ctx context.Context, key, strategy string,
|
||||||
|
@ -2298,6 +2300,7 @@ func (c cmdable) ZAddXX(ctx context.Context, key string, members ...*Z) *IntCmd
|
||||||
|
|
||||||
// ZAddCh Redis `ZADD key CH score member [score member ...]` command.
|
// ZAddCh Redis `ZADD key CH score member [score member ...]` command.
|
||||||
// Deprecated: Use
|
// Deprecated: Use
|
||||||
|
//
|
||||||
// client.ZAddArgs(ctx, ZAddArgs{
|
// client.ZAddArgs(ctx, ZAddArgs{
|
||||||
// Ch: true,
|
// Ch: true,
|
||||||
// Members: []Z,
|
// Members: []Z,
|
||||||
|
@ -2311,6 +2314,7 @@ func (c cmdable) ZAddCh(ctx context.Context, key string, members ...*Z) *IntCmd
|
||||||
|
|
||||||
// ZAddNXCh Redis `ZADD key NX CH score member [score member ...]` command.
|
// ZAddNXCh Redis `ZADD key NX CH score member [score member ...]` command.
|
||||||
// Deprecated: Use
|
// Deprecated: Use
|
||||||
|
//
|
||||||
// client.ZAddArgs(ctx, ZAddArgs{
|
// client.ZAddArgs(ctx, ZAddArgs{
|
||||||
// NX: true,
|
// NX: true,
|
||||||
// Ch: true,
|
// Ch: true,
|
||||||
|
@ -2326,6 +2330,7 @@ func (c cmdable) ZAddNXCh(ctx context.Context, key string, members ...*Z) *IntCm
|
||||||
|
|
||||||
// ZAddXXCh Redis `ZADD key XX CH score member [score member ...]` command.
|
// ZAddXXCh Redis `ZADD key XX CH score member [score member ...]` command.
|
||||||
// Deprecated: Use
|
// Deprecated: Use
|
||||||
|
//
|
||||||
// client.ZAddArgs(ctx, ZAddArgs{
|
// client.ZAddArgs(ctx, ZAddArgs{
|
||||||
// XX: true,
|
// XX: true,
|
||||||
// Ch: true,
|
// Ch: true,
|
||||||
|
@ -2341,6 +2346,7 @@ func (c cmdable) ZAddXXCh(ctx context.Context, key string, members ...*Z) *IntCm
|
||||||
|
|
||||||
// ZIncr Redis `ZADD key INCR score member` command.
|
// ZIncr Redis `ZADD key INCR score member` command.
|
||||||
// Deprecated: Use
|
// Deprecated: Use
|
||||||
|
//
|
||||||
// client.ZAddArgsIncr(ctx, ZAddArgs{
|
// client.ZAddArgsIncr(ctx, ZAddArgs{
|
||||||
// Members: []Z,
|
// Members: []Z,
|
||||||
// })
|
// })
|
||||||
|
@ -2353,6 +2359,7 @@ func (c cmdable) ZIncr(ctx context.Context, key string, member *Z) *FloatCmd {
|
||||||
|
|
||||||
// ZIncrNX Redis `ZADD key NX INCR score member` command.
|
// ZIncrNX Redis `ZADD key NX INCR score member` command.
|
||||||
// Deprecated: Use
|
// Deprecated: Use
|
||||||
|
//
|
||||||
// client.ZAddArgsIncr(ctx, ZAddArgs{
|
// client.ZAddArgsIncr(ctx, ZAddArgs{
|
||||||
// NX: true,
|
// NX: true,
|
||||||
// Members: []Z,
|
// Members: []Z,
|
||||||
|
@ -2367,6 +2374,7 @@ func (c cmdable) ZIncrNX(ctx context.Context, key string, member *Z) *FloatCmd {
|
||||||
|
|
||||||
// ZIncrXX Redis `ZADD key XX INCR score member` command.
|
// ZIncrXX Redis `ZADD key XX INCR score member` command.
|
||||||
// Deprecated: Use
|
// Deprecated: Use
|
||||||
|
//
|
||||||
// client.ZAddArgsIncr(ctx, ZAddArgs{
|
// client.ZAddArgsIncr(ctx, ZAddArgs{
|
||||||
// XX: true,
|
// XX: true,
|
||||||
// Members: []Z,
|
// Members: []Z,
|
||||||
|
@ -2488,11 +2496,13 @@ func (c cmdable) ZPopMin(ctx context.Context, key string, count ...int64) *ZSlic
|
||||||
|
|
||||||
// ZRangeArgs is all the options of the ZRange command.
|
// ZRangeArgs is all the options of the ZRange command.
|
||||||
// In version> 6.2.0, you can replace the(cmd):
|
// In version> 6.2.0, you can replace the(cmd):
|
||||||
// ZREVRANGE,
|
//
|
||||||
// ZRANGEBYSCORE,
|
// ZREVRANGE,
|
||||||
// ZREVRANGEBYSCORE,
|
// ZRANGEBYSCORE,
|
||||||
// ZRANGEBYLEX,
|
// ZREVRANGEBYSCORE,
|
||||||
// ZREVRANGEBYLEX.
|
// ZRANGEBYLEX,
|
||||||
|
// ZREVRANGEBYLEX.
|
||||||
|
//
|
||||||
// Please pay attention to your redis-server version.
|
// Please pay attention to your redis-server version.
|
||||||
//
|
//
|
||||||
// Rev, ByScore, ByLex and Offset+Count options require redis-server 6.2.0 and higher.
|
// Rev, ByScore, ByLex and Offset+Count options require redis-server 6.2.0 and higher.
|
||||||
|
@ -2897,7 +2907,7 @@ func (c cmdable) ClientKill(ctx context.Context, ipPort string) *StatusCmd {
|
||||||
|
|
||||||
// ClientKillByFilter is new style syntax, while the ClientKill is old
|
// ClientKillByFilter is new style syntax, while the ClientKill is old
|
||||||
//
|
//
|
||||||
// CLIENT KILL <option> [value] ... <option> [value]
|
// CLIENT KILL <option> [value] ... <option> [value]
|
||||||
func (c cmdable) ClientKillByFilter(ctx context.Context, keys ...string) *IntCmd {
|
func (c cmdable) ClientKillByFilter(ctx context.Context, keys ...string) *IntCmd {
|
||||||
args := make([]interface{}, 2+len(keys))
|
args := make([]interface{}, 2+len(keys))
|
||||||
args[0] = "client"
|
args[0] = "client"
|
||||||
|
|
|
@ -10,8 +10,8 @@ import (
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8"
|
"git.internal/re/redis/v8"
|
||||||
"github.com/go-redis/redis/v8/internal/proto"
|
"git.internal/re/redis/v8/internal/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = Describe("Commands", func() {
|
var _ = Describe("Commands", func() {
|
||||||
|
|
4
error.go
4
error.go
|
@ -6,8 +6,8 @@ import (
|
||||||
"net"
|
"net"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8/internal/pool"
|
"git.internal/re/redis/v8/internal/pool"
|
||||||
"github.com/go-redis/redis/v8/internal/proto"
|
"git.internal/re/redis/v8/internal/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ErrClosed performs any operation on the closed client will return this error.
|
// ErrClosed performs any operation on the closed client will return this error.
|
||||||
|
|
|
@ -2,6 +2,6 @@ module github.com/go-redis/redis/example/del-keys-without-ttl
|
||||||
|
|
||||||
go 1.14
|
go 1.14
|
||||||
|
|
||||||
replace github.com/go-redis/redis/v8 => ../..
|
replace git.internal/re/redis/v8 => ../..
|
||||||
|
|
||||||
require github.com/go-redis/redis/v8 v8.11.5
|
require git.internal/re/redis/v8 v8.11.5
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8"
|
"git.internal/re/redis/v8"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
@ -2,6 +2,6 @@ module github.com/go-redis/redis/example/hll
|
||||||
|
|
||||||
go 1.14
|
go 1.14
|
||||||
|
|
||||||
replace github.com/go-redis/redis/v8 => ../..
|
replace git.internal/re/redis/v8 => ../..
|
||||||
|
|
||||||
require github.com/go-redis/redis/v8 v8.11.5
|
require git.internal/re/redis/v8 v8.11.5
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8"
|
"git.internal/re/redis/v8"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
@ -2,6 +2,6 @@ module github.com/go-redis/redis/example/redis-bloom
|
||||||
|
|
||||||
go 1.14
|
go 1.14
|
||||||
|
|
||||||
replace github.com/go-redis/redis/v8 => ../..
|
replace git.internal/re/redis/v8 => ../..
|
||||||
|
|
||||||
require github.com/go-redis/redis/v8 v8.11.5
|
require git.internal/re/redis/v8 v8.11.5
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8"
|
"git.internal/re/redis/v8"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
@ -2,7 +2,7 @@ module github.com/go-redis/redis/example/otel
|
||||||
|
|
||||||
go 1.14
|
go 1.14
|
||||||
|
|
||||||
replace github.com/go-redis/redis/v8 => ../..
|
replace git.internal/re/redis/v8 => ../..
|
||||||
|
|
||||||
replace github.com/go-redis/redis/extra/redisotel/v8 => ../../extra/redisotel
|
replace github.com/go-redis/redis/extra/redisotel/v8 => ../../extra/redisotel
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ replace github.com/go-redis/redis/extra/rediscmd/v8 => ../../extra/rediscmd
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/go-redis/redis/extra/redisotel/v8 v8.11.5
|
github.com/go-redis/redis/extra/redisotel/v8 v8.11.5
|
||||||
github.com/go-redis/redis/v8 v8.11.5
|
git.internal/re/redis/v8 v8.11.5
|
||||||
github.com/uptrace/opentelemetry-go-extra/otelplay v0.1.10
|
github.com/uptrace/opentelemetry-go-extra/otelplay v0.1.10
|
||||||
go.opentelemetry.io/otel v1.5.0
|
go.opentelemetry.io/otel v1.5.0
|
||||||
go.opentelemetry.io/otel/exporters/jaeger v1.5.0 // indirect
|
go.opentelemetry.io/otel/exporters/jaeger v1.5.0 // indirect
|
||||||
|
|
|
@ -10,8 +10,8 @@ import (
|
||||||
"go.opentelemetry.io/otel/codes"
|
"go.opentelemetry.io/otel/codes"
|
||||||
semconv "go.opentelemetry.io/otel/semconv/v1.7.0"
|
semconv "go.opentelemetry.io/otel/semconv/v1.7.0"
|
||||||
|
|
||||||
|
"git.internal/re/redis/v8"
|
||||||
"github.com/go-redis/redis/extra/redisotel/v8"
|
"github.com/go-redis/redis/extra/redisotel/v8"
|
||||||
"github.com/go-redis/redis/v8"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var tracer = otel.Tracer("redisexample")
|
var tracer = otel.Tracer("redisexample")
|
||||||
|
|
|
@ -2,6 +2,6 @@ module github.com/go-redis/redis/example/redis-bloom
|
||||||
|
|
||||||
go 1.14
|
go 1.14
|
||||||
|
|
||||||
replace github.com/go-redis/redis/v8 => ../..
|
replace git.internal/re/redis/v8 => ../..
|
||||||
|
|
||||||
require github.com/go-redis/redis/v8 v8.11.5
|
require git.internal/re/redis/v8 v8.11.5
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8"
|
"git.internal/re/redis/v8"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
@ -2,9 +2,9 @@ module github.com/go-redis/redis/example/scan-struct
|
||||||
|
|
||||||
go 1.14
|
go 1.14
|
||||||
|
|
||||||
replace github.com/go-redis/redis/v8 => ../..
|
replace git.internal/re/redis/v8 => ../..
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/davecgh/go-spew v1.1.1
|
github.com/davecgh/go-spew v1.1.1
|
||||||
github.com/go-redis/redis/v8 v8.11.5
|
git.internal/re/redis/v8 v8.11.5
|
||||||
)
|
)
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
|
|
||||||
"github.com/davecgh/go-spew/spew"
|
"github.com/davecgh/go-spew/spew"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8"
|
"git.internal/re/redis/v8"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Model struct {
|
type Model struct {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8"
|
"git.internal/re/redis/v8"
|
||||||
)
|
)
|
||||||
|
|
||||||
type redisHook struct{}
|
type redisHook struct{}
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8"
|
"git.internal/re/redis/v8"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -6,9 +6,9 @@ import (
|
||||||
"net"
|
"net"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8/internal"
|
"git.internal/re/redis/v8/internal"
|
||||||
"github.com/go-redis/redis/v8/internal/hashtag"
|
"git.internal/re/redis/v8/internal/hashtag"
|
||||||
"github.com/go-redis/redis/v8/internal/pool"
|
"git.internal/re/redis/v8/internal/pool"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (c *baseClient) Pool() pool.Pooler {
|
func (c *baseClient) Pool() pool.Pooler {
|
||||||
|
|
|
@ -2,13 +2,13 @@ module github.com/go-redis/redis/extra/rediscensus/v8
|
||||||
|
|
||||||
go 1.15
|
go 1.15
|
||||||
|
|
||||||
replace github.com/go-redis/redis/v8 => ../..
|
replace git.internal/re/redis/v8 => ../..
|
||||||
|
|
||||||
replace github.com/go-redis/redis/extra/rediscmd/v8 => ../rediscmd
|
replace github.com/go-redis/redis/extra/rediscmd/v8 => ../rediscmd
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/go-redis/redis/extra/rediscmd/v8 v8.11.5
|
github.com/go-redis/redis/extra/rediscmd/v8 v8.11.5
|
||||||
github.com/go-redis/redis/v8 v8.11.5
|
git.internal/re/redis/v8 v8.11.5
|
||||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||||
go.opencensus.io v0.23.0
|
go.opencensus.io v0.23.0
|
||||||
)
|
)
|
||||||
|
|
|
@ -5,8 +5,8 @@ import (
|
||||||
|
|
||||||
"go.opencensus.io/trace"
|
"go.opencensus.io/trace"
|
||||||
|
|
||||||
|
"git.internal/re/redis/v8"
|
||||||
"github.com/go-redis/redis/extra/rediscmd/v8"
|
"github.com/go-redis/redis/extra/rediscmd/v8"
|
||||||
"github.com/go-redis/redis/v8"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type TracingHook struct{}
|
type TracingHook struct{}
|
||||||
|
|
|
@ -2,10 +2,10 @@ module github.com/go-redis/redis/extra/rediscmd/v8
|
||||||
|
|
||||||
go 1.15
|
go 1.15
|
||||||
|
|
||||||
replace github.com/go-redis/redis/v8 => ../..
|
replace git.internal/re/redis/v8 => ../..
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/go-redis/redis/v8 v8.11.5
|
git.internal/re/redis/v8 v8.11.5
|
||||||
github.com/onsi/ginkgo v1.16.5
|
github.com/onsi/ginkgo v1.16.5
|
||||||
github.com/onsi/gomega v1.18.1
|
github.com/onsi/gomega v1.18.1
|
||||||
)
|
)
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8"
|
"git.internal/re/redis/v8"
|
||||||
)
|
)
|
||||||
|
|
||||||
func CmdString(cmd redis.Cmder) string {
|
func CmdString(cmd redis.Cmder) string {
|
||||||
|
|
|
@ -12,7 +12,7 @@ Tracing is enabled by adding a hook:
|
||||||
|
|
||||||
```go
|
```go
|
||||||
import (
|
import (
|
||||||
"github.com/go-redis/redis/v8"
|
"git.internal/re/redis/v8"
|
||||||
"github.com/go-redis/redis/extra/redisotel"
|
"github.com/go-redis/redis/extra/redisotel"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -2,13 +2,13 @@ module github.com/go-redis/redis/extra/redisotel/v8
|
||||||
|
|
||||||
go 1.15
|
go 1.15
|
||||||
|
|
||||||
replace github.com/go-redis/redis/v8 => ../..
|
replace git.internal/re/redis/v8 => ../..
|
||||||
|
|
||||||
replace github.com/go-redis/redis/extra/rediscmd/v8 => ../rediscmd
|
replace github.com/go-redis/redis/extra/rediscmd/v8 => ../rediscmd
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/go-redis/redis/extra/rediscmd/v8 v8.11.5
|
github.com/go-redis/redis/extra/rediscmd/v8 v8.11.5
|
||||||
github.com/go-redis/redis/v8 v8.11.5
|
git.internal/re/redis/v8 v8.11.5
|
||||||
go.opentelemetry.io/otel v1.5.0
|
go.opentelemetry.io/otel v1.5.0
|
||||||
go.opentelemetry.io/otel/sdk v1.4.1
|
go.opentelemetry.io/otel/sdk v1.4.1
|
||||||
go.opentelemetry.io/otel/trace v1.5.0
|
go.opentelemetry.io/otel/trace v1.5.0
|
||||||
|
|
|
@ -9,8 +9,8 @@ import (
|
||||||
semconv "go.opentelemetry.io/otel/semconv/v1.7.0"
|
semconv "go.opentelemetry.io/otel/semconv/v1.7.0"
|
||||||
"go.opentelemetry.io/otel/trace"
|
"go.opentelemetry.io/otel/trace"
|
||||||
|
|
||||||
|
"git.internal/re/redis/v8"
|
||||||
"github.com/go-redis/redis/extra/rediscmd/v8"
|
"github.com/go-redis/redis/extra/rediscmd/v8"
|
||||||
"github.com/go-redis/redis/v8"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -2,11 +2,12 @@ package redisotel_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
semconv "go.opentelemetry.io/otel/semconv/v1.7.0"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
semconv "go.opentelemetry.io/otel/semconv/v1.7.0"
|
||||||
|
|
||||||
|
"git.internal/re/redis/v8"
|
||||||
"github.com/go-redis/redis/extra/redisotel/v8"
|
"github.com/go-redis/redis/extra/redisotel/v8"
|
||||||
"github.com/go-redis/redis/v8"
|
|
||||||
"go.opentelemetry.io/otel"
|
"go.opentelemetry.io/otel"
|
||||||
sdktrace "go.opentelemetry.io/otel/sdk/trace"
|
sdktrace "go.opentelemetry.io/otel/sdk/trace"
|
||||||
"go.opentelemetry.io/otel/trace"
|
"go.opentelemetry.io/otel/trace"
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8"
|
"git.internal/re/redis/v8"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
2
go.mod
2
go.mod
|
@ -1,4 +1,4 @@
|
||||||
module github.com/go-redis/redis/v8
|
module git.internal/re/redis/v8
|
||||||
|
|
||||||
go 1.17
|
go 1.17
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ package hashtag
|
||||||
import (
|
import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8/internal/rand"
|
"git.internal/re/redis/v8/internal/rand"
|
||||||
)
|
)
|
||||||
|
|
||||||
const slotNumber = 16384
|
const slotNumber = 16384
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8/internal/rand"
|
"git.internal/re/redis/v8/internal/rand"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestGinkgoSuite(t *testing.T) {
|
func TestGinkgoSuite(t *testing.T) {
|
||||||
|
|
|
@ -3,7 +3,7 @@ package internal
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8/internal/rand"
|
"git.internal/re/redis/v8/internal/rand"
|
||||||
)
|
)
|
||||||
|
|
||||||
func RetryBackoff(retry int, minBackoff, maxBackoff time.Duration) time.Duration {
|
func RetryBackoff(retry int, minBackoff, maxBackoff time.Duration) time.Duration {
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8/internal/pool"
|
"git.internal/re/redis/v8/internal/pool"
|
||||||
)
|
)
|
||||||
|
|
||||||
type poolGetPutBenchmark struct {
|
type poolGetPutBenchmark struct {
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8/internal/proto"
|
"git.internal/re/redis/v8/internal/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
var noDeadline = time.Time{}
|
var noDeadline = time.Time{}
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8/internal"
|
"git.internal/re/redis/v8/internal"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8/internal/pool"
|
"git.internal/re/redis/v8/internal/pool"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = Describe("ConnPool", func() {
|
var _ = Describe("ConnPool", func() {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8/internal/util"
|
"git.internal/re/redis/v8/internal/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
// redis resp protocol data type.
|
// redis resp protocol data type.
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8/internal/proto"
|
"git.internal/re/redis/v8/internal/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
func BenchmarkReader_ParseReply_Status(b *testing.B) {
|
func BenchmarkReader_ParseReply_Status(b *testing.B) {
|
||||||
|
|
|
@ -7,10 +7,11 @@ import (
|
||||||
"reflect"
|
"reflect"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8/internal/util"
|
"git.internal/re/redis/v8/internal/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Scan parses bytes `b` to `v` with appropriate type.
|
// Scan parses bytes `b` to `v` with appropriate type.
|
||||||
|
//
|
||||||
//nolint:gocyclo
|
//nolint:gocyclo
|
||||||
func Scan(b []byte, v interface{}) error {
|
func Scan(b []byte, v interface{}) error {
|
||||||
switch v := v.(type) {
|
switch v := v.(type) {
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8/internal/proto"
|
"git.internal/re/redis/v8/internal/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type testScanSliceStruct struct {
|
type testScanSliceStruct struct {
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8/internal/util"
|
"git.internal/re/redis/v8/internal/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
type writer interface {
|
type writer interface {
|
||||||
|
|
|
@ -11,7 +11,7 @@ import (
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8/internal/proto"
|
"git.internal/re/redis/v8/internal/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
type MyType struct{}
|
type MyType struct{}
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8/internal/util"
|
"git.internal/re/redis/v8/internal/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Sleep(ctx context.Context, dur time.Duration) error {
|
func Sleep(ctx context.Context, dur time.Duration) error {
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8"
|
"git.internal/re/redis/v8"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = Describe("ScanIterator", func() {
|
var _ = Describe("ScanIterator", func() {
|
||||||
|
|
|
@ -15,7 +15,7 @@ import (
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8"
|
"git.internal/re/redis/v8"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
54
options.go
54
options.go
|
@ -13,7 +13,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8/internal/pool"
|
"git.internal/re/redis/v8/internal/pool"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Limiter is the interface of a rate limiter or a circuit breaker.
|
// Limiter is the interface of a rate limiter or a circuit breaker.
|
||||||
|
@ -196,32 +196,38 @@ func (opt *Options) clone() *Options {
|
||||||
// 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:
|
||||||
// redis://<user>:<password>@<host>:<port>/<db_number>
|
//
|
||||||
|
// redis://<user>:<password>@<host>:<port>/<db_number>
|
||||||
|
//
|
||||||
// Unix connection:
|
// Unix connection:
|
||||||
// unix://<user>:<password>@</path/to/redis.sock>?db=<db_number>
|
//
|
||||||
|
// unix://<user>:<password>@</path/to/redis.sock>?db=<db_number>
|
||||||
|
//
|
||||||
// Most Option fields can be set using query parameters, with the following restrictions:
|
// Most Option fields can be set using query parameters, with the following restrictions:
|
||||||
// - 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 intepreted 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 paremeters 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
|
||||||
|
//
|
||||||
// Examples:
|
// Examples:
|
||||||
// redis://user:password@localhost:6789/3?dial_timeout=3&db=1&read_timeout=6s&max_retries=2
|
//
|
||||||
// is equivalent to:
|
// redis://user:password@localhost:6789/3?dial_timeout=3&db=1&read_timeout=6s&max_retries=2
|
||||||
// &Options{
|
// is equivalent to:
|
||||||
// Network: "tcp",
|
// &Options{
|
||||||
// Addr: "localhost:6789",
|
// Network: "tcp",
|
||||||
// DB: 1, // path "/3" was overridden by "&db=1"
|
// Addr: "localhost:6789",
|
||||||
// DialTimeout: 3 * time.Second, // no time unit = seconds
|
// DB: 1, // path "/3" was overridden by "&db=1"
|
||||||
// ReadTimeout: 6 * time.Second,
|
// DialTimeout: 3 * time.Second, // no time unit = seconds
|
||||||
// MaxRetries: 2,
|
// ReadTimeout: 6 * time.Second,
|
||||||
// }
|
// MaxRetries: 2,
|
||||||
|
// }
|
||||||
func ParseURL(redisURL string) (*Options, error) {
|
func ParseURL(redisURL string) (*Options, error) {
|
||||||
u, err := url.Parse(redisURL)
|
u, err := url.Parse(redisURL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8/internal/pool"
|
"git.internal/re/redis/v8/internal/pool"
|
||||||
)
|
)
|
||||||
|
|
||||||
type pipelineExecer func(context.Context, []Cmder) error
|
type pipelineExecer func(context.Context, []Cmder) error
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8"
|
"git.internal/re/redis/v8"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = Describe("pipelining", func() {
|
var _ = Describe("pipelining", func() {
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8"
|
"git.internal/re/redis/v8"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = Describe("pool", func() {
|
var _ = Describe("pool", func() {
|
||||||
|
|
|
@ -7,9 +7,9 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8/internal"
|
"git.internal/re/redis/v8/internal"
|
||||||
"github.com/go-redis/redis/v8/internal/pool"
|
"git.internal/re/redis/v8/internal/pool"
|
||||||
"github.com/go-redis/redis/v8/internal/proto"
|
"git.internal/re/redis/v8/internal/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
// PubSub implements Pub/Sub commands as described in
|
// PubSub implements Pub/Sub commands as described in
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8"
|
"git.internal/re/redis/v8"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = Describe("PubSub", func() {
|
var _ = Describe("PubSub", func() {
|
||||||
|
|
|
@ -13,7 +13,7 @@ import (
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8"
|
"git.internal/re/redis/v8"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = Describe("races", func() {
|
var _ = Describe("races", func() {
|
||||||
|
|
42
redis.go
42
redis.go
|
@ -7,9 +7,9 @@ import (
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8/internal"
|
"git.internal/re/redis/v8/internal"
|
||||||
"github.com/go-redis/redis/v8/internal/pool"
|
"git.internal/re/redis/v8/internal/pool"
|
||||||
"github.com/go-redis/redis/v8/internal/proto"
|
"git.internal/re/redis/v8/internal/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Nil reply returned by Redis when key does not exist.
|
// Nil reply returned by Redis when key does not exist.
|
||||||
|
@ -668,26 +668,26 @@ func (c *Client) pubSub() *PubSub {
|
||||||
// subscription may not be active immediately. To force the connection to wait,
|
// subscription may not be active immediately. To force the connection to wait,
|
||||||
// you may call the Receive() method on the returned *PubSub like so:
|
// you may call the Receive() method on the returned *PubSub like so:
|
||||||
//
|
//
|
||||||
// sub := client.Subscribe(queryResp)
|
// sub := client.Subscribe(queryResp)
|
||||||
// iface, err := sub.Receive()
|
// iface, err := sub.Receive()
|
||||||
// if err != nil {
|
// if err != nil {
|
||||||
// // handle error
|
// // handle error
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// // Should be *Subscription, but others are possible if other actions have been
|
// // Should be *Subscription, but others are possible if other actions have been
|
||||||
// // taken on sub since it was created.
|
// // taken on sub since it was created.
|
||||||
// switch iface.(type) {
|
// switch iface.(type) {
|
||||||
// case *Subscription:
|
// case *Subscription:
|
||||||
// // subscribe succeeded
|
// // subscribe succeeded
|
||||||
// case *Message:
|
// case *Message:
|
||||||
// // received first message
|
// // received first message
|
||||||
// case *Pong:
|
// case *Pong:
|
||||||
// // pong received
|
// // pong received
|
||||||
// default:
|
// default:
|
||||||
// // handle error
|
// // handle error
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// ch := sub.Channel()
|
// ch := sub.Channel()
|
||||||
func (c *Client) Subscribe(ctx context.Context, channels ...string) *PubSub {
|
func (c *Client) Subscribe(ctx context.Context, channels ...string) *PubSub {
|
||||||
pubsub := c.pubSub()
|
pubsub := c.pubSub()
|
||||||
if len(channels) > 0 {
|
if len(channels) > 0 {
|
||||||
|
|
|
@ -11,7 +11,7 @@ import (
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8"
|
"git.internal/re/redis/v8"
|
||||||
)
|
)
|
||||||
|
|
||||||
type redisHookError struct {
|
type redisHookError struct {
|
||||||
|
|
8
ring.go
8
ring.go
|
@ -14,10 +14,10 @@ import (
|
||||||
"github.com/cespare/xxhash/v2"
|
"github.com/cespare/xxhash/v2"
|
||||||
rendezvous "github.com/dgryski/go-rendezvous" //nolint
|
rendezvous "github.com/dgryski/go-rendezvous" //nolint
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8/internal"
|
"git.internal/re/redis/v8/internal"
|
||||||
"github.com/go-redis/redis/v8/internal/hashtag"
|
"git.internal/re/redis/v8/internal/hashtag"
|
||||||
"github.com/go-redis/redis/v8/internal/pool"
|
"git.internal/re/redis/v8/internal/pool"
|
||||||
"github.com/go-redis/redis/v8/internal/rand"
|
"git.internal/re/redis/v8/internal/rand"
|
||||||
)
|
)
|
||||||
|
|
||||||
var errRingShardsDown = errors.New("redis: all ring shards are down")
|
var errRingShardsDown = errors.New("redis: all ring shards are down")
|
||||||
|
|
|
@ -12,7 +12,7 @@ import (
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8"
|
"git.internal/re/redis/v8"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = Describe("Redis Ring", func() {
|
var _ = Describe("Redis Ring", func() {
|
||||||
|
|
|
@ -9,9 +9,9 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8/internal"
|
"git.internal/re/redis/v8/internal"
|
||||||
"github.com/go-redis/redis/v8/internal/pool"
|
"git.internal/re/redis/v8/internal/pool"
|
||||||
"github.com/go-redis/redis/v8/internal/rand"
|
"git.internal/re/redis/v8/internal/rand"
|
||||||
)
|
)
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8"
|
"git.internal/re/redis/v8"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = Describe("Sentinel", func() {
|
var _ = Describe("Sentinel", func() {
|
||||||
|
@ -221,7 +221,7 @@ var _ = Describe("SentinelAclAuth", func() {
|
||||||
|
|
||||||
var client *redis.Client
|
var client *redis.Client
|
||||||
var sentinel *redis.SentinelClient
|
var sentinel *redis.SentinelClient
|
||||||
var sentinels = func() []*redisProcess {
|
sentinels := func() []*redisProcess {
|
||||||
return []*redisProcess{sentinel1, sentinel2, sentinel3}
|
return []*redisProcess{sentinel1, sentinel2, sentinel3}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
4
tx.go
4
tx.go
|
@ -3,8 +3,8 @@ package redis
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8/internal/pool"
|
"git.internal/re/redis/v8/internal/pool"
|
||||||
"github.com/go-redis/redis/v8/internal/proto"
|
"git.internal/re/redis/v8/internal/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TxFailedErr transaction redis failed.
|
// TxFailedErr transaction redis failed.
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8"
|
"git.internal/re/redis/v8"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = Describe("Tx", func() {
|
var _ = Describe("Tx", func() {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
|
|
||||||
"github.com/go-redis/redis/v8"
|
"git.internal/re/redis/v8"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = Describe("UniversalClient", func() {
|
var _ = Describe("UniversalClient", func() {
|
||||||
|
|
Loading…
Reference in New Issue