mirror of
https://github.com/redis/go-redis.git
synced 2025-07-28 06:42:00 +03:00
Unexport helper command
This commit is contained in:
@ -6,6 +6,7 @@ import (
|
||||
"net"
|
||||
"strings"
|
||||
|
||||
"github.com/go-redis/redis/v8/internal"
|
||||
"github.com/go-redis/redis/v8/internal/hashtag"
|
||||
"github.com/go-redis/redis/v8/internal/pool"
|
||||
)
|
||||
@ -82,3 +83,13 @@ func (state *clusterState) IsConsistent(ctx context.Context) bool {
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
func GetSlavesAddrByName(ctx context.Context, c *SentinelClient, name string) []string {
|
||||
addrs, err := c.Slaves(ctx, name).Result()
|
||||
if err != nil {
|
||||
internal.Logger.Printf(ctx, "sentinel: Slaves name=%q failed: %s",
|
||||
name, err)
|
||||
return []string{}
|
||||
}
|
||||
return parseSlaveAddrs(addrs, false)
|
||||
}
|
||||
|
Reference in New Issue
Block a user