MCPcopy Create free account
hub / github.com/TalkingData/owl / get

Method get

controller/cache/cache.go:74–84  ·  view source on GitHub ↗
(k string)

Source from the content-addressed store, hash-verified

72}
73
74func (c *cache) get(k string) (interface{}, bool) {
75 item, found := c.items[k]
76 if !found {
77 return nil, false
78 }
79 //check item expired
80 if item.Expiration > 0 && item.Expiration < time.Now().UnixNano() {
81 return nil, false
82 }
83 return item.Object, true
84}
85
86func (c *cache) Add(k string, x interface{}, d time.Duration) error {
87 c.mu.Lock()

Callers 2

AddMethod · 0.95
ReplaceMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected