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

Method Random

osscluster.go:780–788  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

778}
779
780func (c *clusterNodes) Random() (*clusterNode, error) {
781 addrs, err := c.Addrs()
782 if err != nil {
783 return nil, err
784 }
785
786 n := rand.Intn(len(addrs))
787 return c.GetOrCreate(addrs[n])
788}
789
790//------------------------------------------------------------------------------
791

Callers 6

slotMasterNodeMethod · 0.45
slotSlaveNodeMethod · 0.45
slotClosestNodeMethod · 0.45
slotRandomNodeMethod · 0.45
pubSubMethod · 0.45

Calls 2

AddrsMethod · 0.95
GetOrCreateMethod · 0.95

Tested by

no test coverage detected