MCPcopy Create free account
hub / github.com/allegro/bigcache / Append

Method Append

bigcache.go:158–162  ·  view source on GitHub ↗

Append appends entry under the key if key exists, otherwise it will set the key (same behaviour as Set()). With Append() you can concatenate multiple entries under the same key in an lock optimized way.

(key string, entry []byte)

Source from the content-addressed store, hash-verified

156// it will set the key (same behaviour as Set()). With Append() you can
157// concatenate multiple entries under the same key in an lock optimized way.
158func (c *BigCache) Append(key string, entry []byte) error {
159 hashedKey := c.hash.Sum64(key)
160 shard := c.getShard(hashedKey)
161 return shard.append(key, hashedKey, entry)
162}
163
164// Delete removes the key
165func (c *BigCache) Delete(key string) error {

Callers 4

appendToCacheFunction · 0.80
TestAppendAndGetOnCacheFunction · 0.80
TestAppendRandomlyFunction · 0.80
TestAppendCollisionFunction · 0.80

Calls 3

getShardMethod · 0.95
appendMethod · 0.80
Sum64Method · 0.65

Tested by 4

appendToCacheFunction · 0.64
TestAppendAndGetOnCacheFunction · 0.64
TestAppendRandomlyFunction · 0.64
TestAppendCollisionFunction · 0.64