diff options
author | EuAndreh <eu@euandre.org> | 2025-02-10 14:33:18 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2025-02-10 14:39:42 -0300 |
commit | e71d5f9df58d23f9ede7bfad6008a1b93d7bd732 (patch) | |
tree | 06a9501db57da83b43466a68531fde7160258edd | |
parent | src/dedo.go: Move implementation of Tx public methods into private functions (diff) | |
download | dedo-e71d5f9df58d23f9ede7bfad6008a1b93d7bd732.tar.gz dedo-e71d5f9df58d23f9ede7bfad6008a1b93d7bd732.tar.xz |
src/dedo.go: Remove *cursorT appearance from public API
-rw-r--r-- | src/dedo.go | 11 |
1 files 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) } |