(ctx context.Context, slot int)
| 25 | } |
| 26 | |
| 27 | func (c *ClusterClient) SlotAddrs(ctx context.Context, slot int) []string { |
| 28 | state, err := c.state.Get(ctx) |
| 29 | if err != nil { |
| 30 | panic(err) |
| 31 | } |
| 32 | |
| 33 | var addrs []string |
| 34 | for _, n := range state.slotNodes(slot) { |
| 35 | addrs = append(addrs, n.Client.getAddr()) |
| 36 | } |
| 37 | return addrs |
| 38 | } |
| 39 | |
| 40 | func (c *ClusterClient) Nodes(ctx context.Context, key string) ([]*clusterNode, error) { |
| 41 | state, err := c.state.Reload(ctx) |