(key, value interface{}, ttl int64)
| 42 | } |
| 43 | |
| 44 | func (c *MemoryCache) Set(key, value interface{}, ttl int64) error { |
| 45 | c.Lock() |
| 46 | c.cache[key] = &item{ |
| 47 | value: value, |
| 48 | createdAt: time.Now().Unix(), |
| 49 | ttl: ttl, |
| 50 | } |
| 51 | c.Unlock() |
| 52 | |
| 53 | return nil |
| 54 | } |
| 55 | |
| 56 | func (c *MemoryCache) Get(key interface{}) (interface{}, error) { |
| 57 | c.RLock() |
nothing calls this directly
no outgoing calls
no test coverage detected