Get retrieves an element from map under given key.
(key string)
| 91 | |
| 92 | // Get retrieves an element from map under given key. |
| 93 | func (slm ShardLockMaps) Get(key string) (interface{}, bool) { |
| 94 | shard := slm.GetShard(key) |
| 95 | shard.RLock() |
| 96 | val, ok := shard.items[key] |
| 97 | shard.RUnlock() |
| 98 | return val, ok |
| 99 | } |
| 100 | |
| 101 | // Set Sets the given value under the specified key. |
| 102 | func (slm ShardLockMaps) Set(key string, value interface{}) { |