Skip to content

Commit ddc3f09

Browse files
chore: make a type alias in DB interface (#114)
* make a type alias in DB interface * changelog
1 parent e75f6e4 commit ddc3f09

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## UNRELEASED
44

55
* Allow full control in rocksdb opening
6+
* Make `Iteractor` and `Batch` interfaces more flexible by a type alias
67

78
## [v1.0.2] - 2024-02-26
89

types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ type DB interface {
8181
//
8282
// As with DB, given keys and values should be considered read-only, and must not be modified after
8383
// passing them to the batch.
84-
type Batch interface {
84+
type Batch = interface {
8585
// Set sets a key/value pair.
8686
// CONTRACT: key, value readonly []byte
8787
Set(key, value []byte) error
@@ -130,7 +130,7 @@ type Batch interface {
130130
// if err := itr.Error(); err != nil {
131131
// ...
132132
// }
133-
type Iterator interface {
133+
type Iterator = interface {
134134
// Domain returns the start (inclusive) and end (exclusive) limits of the iterator.
135135
// CONTRACT: start, end readonly []byte
136136
Domain() (start []byte, end []byte)

0 commit comments

Comments
 (0)