MCPcopy
hub / github.com/fagongzi/manba / Get

Method Get

pkg/util/lru.go:73–89  ·  view source on GitHub ↗

Get looks up a key's value from the cache.

(key Key)

Source from the content-addressed store, hash-verified

71
72// Get looks up a key's value from the cache.
73func (c *Cache) Get(key Key) (value []byte, ok bool) {
74 c.RLock()
75
76 if c.cache == nil {
77 c.RUnlock()
78 return
79 }
80
81 if ele, hit := c.cache[key]; hit {
82 c.ll.MoveToFront(ele)
83 c.RUnlock()
84 return ele.Value.(*entry).value, true
85 }
86
87 c.RUnlock()
88 return
89}
90
91// Remove removes the provided key from the cache.
92func (c *Cache) Remove(key Key) {

Callers 15

getMethod · 0.80
getValueMethod · 0.80
getRedisMethod · 0.80
acquireWGFunction · 0.80
acquireMultiContextFunction · 0.80
acquireDispathNodeFunction · 0.80
acquireContextFunction · 0.80
acquireRenderFunction · 0.80
PreMethod · 0.80
extractAttrValueMethod · 0.80
getAttrMethod · 0.80
paramValueFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected