(key string)
| 434 | } |
| 435 | |
| 436 | func (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 | |
| 451 | func (c *ringSharding) GetByKey(key string) (*ringShard, error) { |
| 452 | key = hashtag.Key(key) |
no test coverage detected