MCPcopy
hub / github.com/aceld/zinx / Set

Method Set

zutils/shard_lock_map.go:102–107  ·  view source on GitHub ↗

Set Sets the given value under the specified key.

(key string, value interface{})

Source from the content-addressed store, hash-verified

100
101// Set Sets the given value under the specified key.
102func (slm ShardLockMaps) Set(key string, value interface{}) {
103 shard := slm.GetShard(key)
104 shard.Lock()
105 shard.items[key] = value
106 shard.Unlock()
107}
108
109// SetNX Sets the given value under the specified key if no value was associated with it.
110func (slm ShardLockMaps) SetNX(key string, value interface{}) bool {

Callers 15

BenchmarkItemsFunction · 0.95
BenchmarkKeysFunction · 0.95
BenchmarkMarshalJsonFunction · 0.95
BenchmarkMultiInsertSameFunction · 0.95
BenchmarkMultiGetSameFunction · 0.95
TestSetFunction · 0.95
TestGetFunction · 0.95
TestHasFunction · 0.95

Calls 1

GetShardMethod · 0.95

Tested by 15

BenchmarkItemsFunction · 0.76
BenchmarkKeysFunction · 0.76
BenchmarkMarshalJsonFunction · 0.76
BenchmarkMultiInsertSameFunction · 0.76
BenchmarkMultiGetSameFunction · 0.76
TestSetFunction · 0.76
TestGetFunction · 0.76
TestHasFunction · 0.76