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

Method Set

controller/cache/cache.go:41–57  ·  view source on GitHub ↗
(k string, x interface{}, d time.Duration)

Source from the content-addressed store, hash-verified

39}
40
41func (c *cache) Set(k string, x interface{}, d time.Duration) {
42 var e int64
43 if d == DefaultExpiration {
44 d = c.defaultExpiration
45 }
46
47 if d > 0 {
48 e = time.Now().Add(d).UnixNano()
49 }
50 c.mu.Lock()
51 c.items[k] = Item{
52 Object: x,
53 Expiration: e,
54 }
55 c.mu.Unlock()
56
57}
58
59func (c *cache) set(k string, x interface{}, d time.Duration) {
60 var e int64

Callers 12

processSingleStrategyMethod · 0.80
iamLogoutFunction · 0.80
paginationFunction · 0.80
AuthIAMFunction · 0.80
AuthMySQLFunction · 0.80
JudgePermissionFunction · 0.80
verifyAndInjectProductIDFunction · 0.80
verifyAndInjectPanelIDFunction · 0.80
QueryMethod · 0.80
QueryMethod · 0.80

Calls 1

AddMethod · 0.45

Tested by

no test coverage detected