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

Method Put

driver/badger/db.go:23–31  ·  view source on GitHub ↗
(key, value []byte)

Source from the content-addressed store, hash-verified

21}
22
23func (db *DB) Put(key, value []byte) error {
24 return db.db.Update(func(txn *badger.Txn) error {
25 e := badger.NewEntry(key, value)
26 if db.encryptionKey != nil {
27 e.WithMeta(1) // Mark as encrypted
28 }
29 return txn.SetEntry(e)
30 })
31}
32
33func (db *DB) Get(key []byte) ([]byte, error) {
34 v := []byte{}

Callers 1

SyncPutMethod · 0.95

Calls 1

UpdateMethod · 0.65

Tested by

no test coverage detected