MCPcopy Index your code
hub / github.com/perkeep/perkeep / Delete

Method Delete

pkg/sorted/buffer/buffer.go:123–138  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

121}
122
123func (kv *KeyValue) Delete(key string) error {
124 kv.mu.RLock()
125 defer kv.mu.RUnlock()
126 // This isn't an ideal implementation, since it synchronously
127 // deletes from the backing store. But deletes aren't really
128 // used, so ignoring for now.
129 // Could also use a syncutil.Group to do these in parallel,
130 // but the buffer should be an in-memory implementation
131 // anyway, so should be fast.
132 err1 := kv.buf.Delete(key)
133 err2 := kv.back.Delete(key)
134 if err1 != nil {
135 return err1
136 }
137 return err2
138}
139
140func (kv *KeyValue) BeginBatch() sorted.BatchMutation {
141 return new(batch)

Callers

nothing calls this directly

Implementers 6

memKeyspkg/sorted/mem.go
kvispkg/sorted/kvfile/kvfile.go
keyValuepkg/sorted/mongo/mongokv.go
KeyValuepkg/sorted/buffer/buffer.go
KeyValuepkg/sorted/sqlkv/sqlkv.go
kvispkg/sorted/leveldb/leveldb.go

Calls 3

RLockMethod · 0.65
RUnlockMethod · 0.65
DeleteMethod · 0.65

Tested by

no test coverage detected