MCPcopy Create free account
hub / github.com/aceld/zinx / Get

Method Get

zutils/shard_lock_map.go:93–99  ·  view source on GitHub ↗

Get retrieves an element from map under given key.

(key string)

Source from the content-addressed store, hash-verified

91
92// Get retrieves an element from map under given key.
93func (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.
102func (slm ShardLockMaps) Set(key string, value interface{}) {

Callers 9

TestGetFunction · 0.95
TestRemoveFunction · 0.95
TestConcurrentFunction · 0.95
TestLockFuncWithKeyFunction · 0.95
TestLockFuncFunction · 0.95
GetOrSetMethod · 0.95
GetOrSetFuncMethod · 0.95
GetOrSetFuncLockMethod · 0.95
MGetMethod · 0.95

Calls 1

GetShardMethod · 0.95

Tested by 5

TestGetFunction · 0.76
TestRemoveFunction · 0.76
TestConcurrentFunction · 0.76
TestLockFuncWithKeyFunction · 0.76
TestLockFuncFunction · 0.76