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

Method Add

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

Source from the content-addressed store, hash-verified

84}
85
86func (c *cache) Add(k string, x interface{}, d time.Duration) error {
87 c.mu.Lock()
88 //check exit
89 _, found := c.get(k)
90 if found {
91 err := fmt.Errorf("Item:%s has already exit", k)
92 return err
93 }
94 //set
95 c.set(k, x, d)
96 c.mu.Unlock()
97 return nil
98}
99
100func (c *cache) Replace(k string, x interface{}, d time.Duration) error {
101 c.mu.Lock()

Callers 10

SendTSD2RepeaterMethod · 0.45
loadStrategiesForeverMethod · 0.45
SetMethod · 0.45
setMethod · 0.45
unitFunction · 0.45
SyncUsersFunction · 0.45
unmuteHostFunction · 0.45
operationListFunction · 0.45
queryTimeSeriesDataFunction · 0.45
GenerateTokenFunction · 0.45

Calls 2

getMethod · 0.95
setMethod · 0.95

Tested by

no test coverage detected