From e71d5f9df58d23f9ede7bfad6008a1b93d7bd732 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Mon, 10 Feb 2025 14:33:18 -0300 Subject: src/dedo.go: Remove *cursorT appearance from public API --- src/dedo.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/dedo.go b/src/dedo.go index 2afcc01..d8655bb 100644 --- a/src/dedo.go +++ b/src/dedo.go @@ -61,9 +61,14 @@ import ( +type CursorI interface{ + First() ([]byte, []byte) + Next() ([]byte, []byte) +} + type SnapshotI interface{ Bucket([]byte) *bucketT - Cursor() *cursorT + Cursor() CursorI ForEach(func([]byte, *bucketT) error) error WriteTo(io.Writer) (int64, error) @@ -72,7 +77,7 @@ type SnapshotI interface{ type TransactionI interface{ Bucket([]byte) *bucketT - Cursor() *cursorT + Cursor() CursorI ForEach(func([]byte, *bucketT) error) error WriteTo(io.Writer) (int64, error) @@ -3552,7 +3557,7 @@ func txCursor(tx *transactionT) *cursorT { return tx.root.Cursor() } -func (tx *transactionT) Cursor() *cursorT { +func (tx *transactionT) Cursor() CursorI { return txCursor(tx) } -- cgit v1.2.3