MCPcopy Create free account
hub / github.com/evilsocket/sum / Delete

Method Delete

storage/index.go:201–215  ·  view source on GitHub ↗

Delete removes a stored object from the index given its identifier, it will return the removed object itself if found, or nil. This operation will also remove the object data file from disk.

(id uint64)

Source from the content-addressed store, hash-verified

199// it will return the removed object itself if found, or nil.
200// This operation will also remove the object data file from disk.
201func (i *Index) Delete(id uint64) proto.Message {
202 i.Lock()
203 defer i.Unlock()
204
205 record, found := i.index[id]
206 if !found {
207 return nil
208 }
209
210 delete(i.index, id)
211
212 os.Remove(i.pathForID(id))
213
214 return record
215}

Callers 9

DeleteRecordMethod · 0.45
DeleteOracleMethod · 0.45
TestIndexDeleteRecordFunction · 0.45
TestOraclesDeleteFunction · 0.45
TestRecordsDeleteFunction · 0.45

Calls 1

pathForIDMethod · 0.95

Tested by 7

TestIndexDeleteRecordFunction · 0.36
TestOraclesDeleteFunction · 0.36
TestRecordsDeleteFunction · 0.36