MCPcopy
hub / github.com/dgraph-io/badger / Set

Method Set

batch.go:149–152  ·  view source on GitHub ↗

Set is equivalent of Txn.Set().

(k, v []byte)

Source from the content-addressed store, hash-verified

147
148// Set is equivalent of Txn.Set().
149func (wb *WriteBatch) Set(k, v []byte) error {
150 e := &Entry{Key: k, Value: v}
151 return wb.SetEntry(e)
152}
153
154// DeleteAt is equivalent of Txn.Delete but accepts a delete timestamp.
155func (wb *WriteBatch) DeleteAt(k []byte, ts uint64) error {

Callers 14

TestWriteBatchFunction · 0.95
TestIteratePrefixFunction · 0.95
TestDropAllFunction · 0.95
TestDropAllTwiceFunction · 0.95
TestDropReadOnlyFunction · 0.95
TestWriteAfterCloseFunction · 0.95
TestDropPrefixFunction · 0.95
TestDropPrefixReadOnlyFunction · 0.95
TestDropAllDropPrefixFunction · 0.95

Calls 1

SetEntryMethod · 0.95

Tested by 12

TestWriteBatchFunction · 0.76
TestIteratePrefixFunction · 0.76
TestDropAllFunction · 0.76
TestDropAllTwiceFunction · 0.76
TestDropReadOnlyFunction · 0.76
TestWriteAfterCloseFunction · 0.76
TestDropPrefixFunction · 0.76
TestDropPrefixReadOnlyFunction · 0.76
TestDropAllDropPrefixFunction · 0.76