Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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)
Expand All @@ -157,3 +159,5 @@ type Iterator = interface {
// Close closes the iterator, relasing any allocated resources.
Close() error
}

type Iterator = IteratorI
Loading