diff --git a/types.go b/types.go index c1e9208..8caa0cc 100644 --- a/types.go +++ b/types.go @@ -81,7 +81,7 @@ type DB interface { // // As with DB, given keys and values should be considered read-only, and must not be modified after // passing them to the batch. -type Batch = interface { +type BatchI interface { // Set sets a key/value pair. // CONTRACT: key, value readonly []byte Set(key, value []byte) error @@ -107,6 +107,8 @@ type Batch = interface { GetByteSize() (int, error) } +type Batch = BatchI + // Iterator represents an iterator over a domain of keys. Callers must call Close when done. // No writes can happen to a domain while there exists an iterator over it, some backends may take // out database locks to ensure this will not happen. @@ -130,7 +132,7 @@ type Batch = interface { // if err := itr.Error(); err != nil { // ... // } -type Iterator = interface { +type IteratorI interface { // Domain returns the start (inclusive) and end (exclusive) limits of the iterator. // CONTRACT: start, end readonly []byte Domain() (start []byte, end []byte) @@ -157,3 +159,5 @@ type Iterator = interface { // Close closes the iterator, relasing any allocated resources. Close() error } + +type Iterator = IteratorI