MCPcopy Create free account
hub / github.com/mpolden/echoip / Get

Method Get

http/cache.go:69–78  ·  view source on GitHub ↗
(ip net.IP)

Source from the content-addressed store, hash-verified

67}
68
69func (c *Cache) Get(ip net.IP) (Response, bool) {
70 k := key(ip)
71 c.mu.RLock()
72 defer c.mu.RUnlock()
73 r, ok := c.entries[k]
74 if !ok {
75 return Response{}, false
76 }
77 return r.Value.(Response), true
78}
79
80func (c *Cache) Resize(capacity int) error {
81 if capacity < 0 {

Callers 5

TestCacheCapacityFunction · 0.95
HeaderMethod · 0.80
ipFromRequestFunction · 0.80
newResponseMethod · 0.80
NotFoundHandlerFunction · 0.80

Calls 1

keyFunction · 0.85

Tested by 1

TestCacheCapacityFunction · 0.76