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

Method Hash

ring.go:436–449  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

434}
435
436func (c *ringSharding) Hash(key string) string {
437 key = hashtag.Key(key)
438
439 var hash string
440
441 c.mu.RLock()
442 defer c.mu.RUnlock()
443
444 if c.numShard > 0 {
445 hash = c.hash.Get(key)
446 }
447
448 return hash
449}
450
451func (c *ringSharding) GetByKey(key string) (*ringShard, error) {
452 key = hashtag.Key(key)

Callers 1

Calls 2

KeyFunction · 0.92
GetMethod · 0.65

Tested by

no test coverage detected