mirror of
https://github.com/redis/go-redis.git
synced 2025-12-25 00:01:00 +03:00
Add ClusterPipeline.
This commit is contained in:
@@ -5,6 +5,23 @@ import (
|
||||
. "github.com/onsi/gomega"
|
||||
)
|
||||
|
||||
// GetSlot returns the cached slot addresses
|
||||
func (c *ClusterClient) GetSlot(pos int) []string {
|
||||
c.slotsMx.RLock()
|
||||
defer c.slotsMx.RUnlock()
|
||||
|
||||
return c.slots[pos]
|
||||
}
|
||||
|
||||
// SwapSlot swaps a slot's master/slave address
|
||||
// for testing MOVED redirects
|
||||
func (c *ClusterClient) SwapSlot(pos int) []string {
|
||||
c.slotsMx.Lock()
|
||||
defer c.slotsMx.Unlock()
|
||||
c.slots[pos][0], c.slots[pos][1] = c.slots[pos][1], c.slots[pos][0]
|
||||
return c.slots[pos]
|
||||
}
|
||||
|
||||
var _ = Describe("ClusterClient", func() {
|
||||
var subject *ClusterClient
|
||||
|
||||
|
||||
Reference in New Issue
Block a user