MCPcopy Index your code
hub / github.com/mpolden/echoip / NewCache

Function NewCache

http/cache.go:25–34  ·  view source on GitHub ↗
(capacity int)

Source from the content-addressed store, hash-verified

23}
24
25func NewCache(capacity int) *Cache {
26 if capacity < 0 {
27 capacity = 0
28 }
29 return &Cache{
30 capacity: capacity,
31 entries: make(map[uint64]*list.Element),
32 values: list.New(),
33 }
34}
35
36func key(ip net.IP) uint64 {
37 h := fnv.New64a()

Callers 5

mainFunction · 0.92
testServerFunction · 0.85
TestCacheCapacityFunction · 0.85
TestCacheDuplicateFunction · 0.85
TestCacheResizeFunction · 0.85

Calls

no outgoing calls

Tested by 4

testServerFunction · 0.68
TestCacheCapacityFunction · 0.68
TestCacheDuplicateFunction · 0.68
TestCacheResizeFunction · 0.68