kaspad/infrastructure/db/database/dataaccessor.go
Svarog 9a756939d8
[NOD-1412] Remove ffldb, remove dataStore from database, store blocks directly in levelDB (#939)
* [NOD-1412] Remove ffldb, and make ldb implement all the database
interfaces

* [NOD-1412] Removed any reference to dataStore and updated block dbaccess to work directly with key/values
2020-09-27 15:40:15 +03:00

25 lines
741 B
Go

package database
// DataAccessor defines the common interface by which data gets
// accessed in a generic kaspad database.
type DataAccessor interface {
// Put sets the value for the given key. It overwrites
// any previous value for that key.
Put(key *Key, value []byte) error
// Get gets the value for the given key. It returns
// ErrNotFound if the given key does not exist.
Get(key *Key) ([]byte, error)
// Has returns true if the database does contains the
// given key.
Has(key *Key) (bool, error)
// Delete deletes the value for the given key. Will not
// return an error if the key doesn't exist.
Delete(key *Key) error
// Cursor begins a new cursor over the given bucket.
Cursor(bucket *Bucket) (Cursor, error)
}