Exist check item exist in runtime cache.
(key string)
| 201 | |
| 202 | // Exist check item exist in runtime cache. |
| 203 | func (ca *RuntimeCache) Exists(key string) (bool, error) { |
| 204 | if itemObj, ok := ca.items.Load(key); ok { |
| 205 | item := itemObj.(*RuntimeItem) |
| 206 | return !item.isExpire(), nil |
| 207 | } |
| 208 | return false, nil |
| 209 | } |
| 210 | |
| 211 | // Delete item in runtime cacha. |
| 212 | // if not exists, we think it's success |