From 2ebb354412c276ba9fc7784e478caf82524df5bf Mon Sep 17 00:00:00 2001 From: Cool Developer Date: Wed, 28 Aug 2024 20:44:05 -0400 Subject: [PATCH 1/2] make a type alias in DB interface --- types.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types.go b/types.go index f358ab1..c1e9208 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 Batch = interface { // Set sets a key/value pair. // CONTRACT: key, value readonly []byte Set(key, value []byte) error @@ -130,7 +130,7 @@ type Batch interface { // if err := itr.Error(); err != nil { // ... // } -type Iterator interface { +type Iterator = interface { // Domain returns the start (inclusive) and end (exclusive) limits of the iterator. // CONTRACT: start, end readonly []byte Domain() (start []byte, end []byte) From 717cba019b33a16dc58a065b3480142563dd72a8 Mon Sep 17 00:00:00 2001 From: Cool Developer Date: Wed, 28 Aug 2024 20:46:18 -0400 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 849eb8c..8ebefe4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## UNRELEASED * Allow full control in rocksdb opening +* Make `Iteractor` and `Batch` interfaces more flexible by a type alias ## [v1.0.2] - 2024-02-26