summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/go-redis/redis/export_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/go-redis/redis/export_test.go')
-rw-r--r--vendor/github.com/go-redis/redis/export_test.go35
1 files changed, 35 insertions, 0 deletions
diff --git a/vendor/github.com/go-redis/redis/export_test.go b/vendor/github.com/go-redis/redis/export_test.go
new file mode 100644
index 000000000..b88e41be9
--- /dev/null
+++ b/vendor/github.com/go-redis/redis/export_test.go
@@ -0,0 +1,35 @@
+package redis
+
+import (
+ "net"
+ "time"
+
+ "github.com/go-redis/redis/internal/pool"
+)
+
+func (c *baseClient) Pool() pool.Pooler {
+ return c.connPool
+}
+
+func (c *PubSub) SetNetConn(netConn net.Conn) {
+ c.cn = pool.NewConn(netConn)
+}
+
+func (c *PubSub) ReceiveMessageTimeout(timeout time.Duration) (*Message, error) {
+ return c.receiveMessage(timeout)
+}
+
+func (c *ClusterClient) SlotAddrs(slot int) []string {
+ var addrs []string
+ for _, n := range c.state().slotNodes(slot) {
+ addrs = append(addrs, n.Client.getAddr())
+ }
+ return addrs
+}
+
+// SwapSlot swaps a slot's master/slave address for testing MOVED redirects.
+func (c *ClusterClient) SwapSlotNodes(slot int) []string {
+ nodes := c.state().slots[slot]
+ nodes[0], nodes[1] = nodes[1], nodes[0]
+ return c.SlotAddrs(slot)
+}