MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / Exist

Method Exist

internal/caches/list_memory.go:92–107  ·  view source on GitHub ↗
(hash string)

Source from the content-addressed store, hash-verified

90}
91
92func (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 根据前缀进行清除
110func (this *MemoryList) CleanPrefix(prefix string) error {

Callers

nothing calls this directly

Calls 4

prefixMethod · 0.95
RLockMethod · 0.80
RUnlockMethod · 0.80
IsExpiredMethod · 0.45

Tested by

no test coverage detected