(hash string)
| 90 | } |
| 91 | |
| 92 | func (this *MemoryList) Exist(hash string) (bool, int64, error) { |
| 93 | this.locker.RLock() |
| 94 | defer this.locker.RUnlock() |
| 95 | |
| 96 | prefix := this.prefix(hash) |
| 97 | itemMap, ok := this.itemMaps[prefix] |
| 98 | if !ok { |
| 99 | return false, -1, nil |
| 100 | } |
| 101 | item, ok := itemMap[hash] |
| 102 | if !ok { |
| 103 | return false, -1, nil |
| 104 | } |
| 105 | |
| 106 | return !item.IsExpired(), -1, nil |
| 107 | } |
| 108 | |
| 109 | // CleanPrefix 根据前缀进行清除 |
| 110 | func (this *MemoryList) CleanPrefix(prefix string) error { |