Method
initValue
(key string, value interface{}, ttl int64)
Source from the content-addressed store, hash-verified
| 111 | } |
| 112 | |
| 113 | func (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. |
| 123 | func (ca *RuntimeCache) Incr(key string) (int64, error) { |
Tested by
no test coverage detected