MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / Delete

Method Delete

driver/ipfs-synckv/write_batch.go:55–74  ·  view source on GitHub ↗
(key []byte)

Source from the content-addressed store, hash-verified

53 w.ipfsOps = append(w.ipfsOps, func() error {
54 return w.db.ipfsDB.Put(w.db.ctx, metaKey, versionBytes)
55 })
56
57 w.db.cache.Del(key)
58}
59
60func (w *WriteBatch) Delete(key []byte) {
61 if w.err != nil {
62 return
63 }
64 metaKey := append([]byte("_meta:"), key...)
65
66 // Add local delete to the leveldb batch
67 w.wbatch.Delete(key)
68 w.wbatch.Delete(metaKey)
69
70 // Add IPFS delete to the pre-commit queue
71 w.ipfsOps = append(w.ipfsOps, func() error {
72 return w.db.ipfsDB.Delete(w.db.ctx, key)
73 })
74 w.ipfsOps = append(w.ipfsOps, func() error {
75 return w.db.ipfsDB.Delete(w.db.ctx, metaKey)
76 })
77

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected