MCPcopy Create free account
hub / github.com/devfeel/dotweb / initValue

Method initValue

cache/runtime/cache_runtime.go:113–120  ·  view source on GitHub ↗
(key string, value interface{}, ttl int64)

Source from the content-addressed store, hash-verified

111}
112
113func (ca *RuntimeCache) initValue(key string, value interface{}, ttl int64) error {
114 ca.items.Store(key, &RuntimeItem{
115 value: value,
116 createTime: time.Now(),
117 ttl: time.Duration(ttl) * time.Second,
118 })
119 return nil
120}
121
122// Incr increase int64 counter in runtime cache.
123func (ca *RuntimeCache) Incr(key string) (int64, error) {

Callers 3

SetMethod · 0.95
IncrMethod · 0.95
DecrMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected