MCPcopy
hub / github.com/redis/go-redis / SlotAddrs

Method SlotAddrs

export_test.go:27–38  ·  view source on GitHub ↗
(ctx context.Context, slot int)

Source from the content-addressed store, hash-verified

25}
26
27func (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
40func (c *ClusterClient) Nodes(ctx context.Context, key string) ([]*clusterNode, error) {
41 state, err := c.state.Reload(ctx)

Callers

nothing calls this directly

Calls 3

slotNodesMethod · 0.80
getAddrMethod · 0.80
GetMethod · 0.65

Tested by

no test coverage detected