mirror of
https://github.com/redis/go-redis.git
synced 2025-07-28 06:42:00 +03:00
feat: ring.SetAddrs to add and remove shards by the ring client and reuse old connections
test: ring scale-in and scale-out rewrite as suggested by @AlexanderYastrebov Signed-off-by: Sandor Szücs <sandor.szuecs@zalando.de>
This commit is contained in:
@ -93,3 +93,11 @@ func GetSlavesAddrByName(ctx context.Context, c *SentinelClient, name string) []
|
||||
}
|
||||
return parseReplicaAddrs(addrs, false)
|
||||
}
|
||||
|
||||
func (c *Ring) GetAddr(addr string) *ringShard {
|
||||
return c.shards.GetAddr(addr)
|
||||
}
|
||||
|
||||
func (c *ringShards) GetAddr(addr string) *ringShard {
|
||||
return c.shards[addr]
|
||||
}
|
||||
|
Reference in New Issue
Block a user