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

Method RemoveFile

internal/utils/bfs/meta_file.go:212–237  ·  view source on GitHub ↗
(hash string)

Source from the content-addressed store, hash-verified

210}
211
212func (this *MetaFile) RemoveFile(hash string) error {
213 this.mu.Lock()
214 defer this.mu.Unlock()
215
216 _, ok := this.headerMap[hash]
217 if ok {
218 delete(this.headerMap, hash)
219 }
220
221 if ok {
222 blockBytes, err := EncodeMetaBlock(MetaActionRemove, hash, nil)
223 if err != nil {
224 return err
225 }
226
227 AckWriteThread()
228 _, err = this.fp.Write(blockBytes)
229 ReleaseWriteThread()
230 if err != nil {
231 return err
232 }
233 this.isModified = true
234 }
235
236 return nil
237}
238
239func (this *MetaFile) FileHeader(hash string) (header *FileHeader, ok bool) {
240 this.mu.RLock()

Callers

nothing calls this directly

Calls 6

EncodeMetaBlockFunction · 0.85
AckWriteThreadFunction · 0.85
ReleaseWriteThreadFunction · 0.85
WriteMethod · 0.65
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected