aboutsummaryrefslogtreecommitdiffstats
path: root/ethdb/interface.go
diff options
context:
space:
mode:
Diffstat (limited to 'ethdb/interface.go')
-rw-r--r--ethdb/interface.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/ethdb/interface.go b/ethdb/interface.go
index 537312003..af1355779 100644
--- a/ethdb/interface.go
+++ b/ethdb/interface.go
@@ -25,12 +25,17 @@ type Putter interface {
Put(key []byte, value []byte) error
}
+// Deleter wraps the database delete operation supported by both batches and regular databases.
+type Deleter interface {
+ Delete(key []byte) error
+}
+
// Database wraps all database operations. All methods are safe for concurrent use.
type Database interface {
Putter
+ Deleter
Get(key []byte) ([]byte, error)
Has(key []byte) (bool, error)
- Delete(key []byte) error
Close()
NewBatch() Batch
}
@@ -39,6 +44,7 @@ type Database interface {
// when Write is called. Batch cannot be used concurrently.
type Batch interface {
Putter
+ Deleter
ValueSize() int // amount of data in the batch
Write() error
// Reset resets the batch for reuse