aboutsummaryrefslogtreecommitdiff
path: root/src/dedo.go
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2025-02-10 14:33:18 -0300
committerEuAndreh <eu@euandre.org>2025-02-10 14:39:42 -0300
commite71d5f9df58d23f9ede7bfad6008a1b93d7bd732 (patch)
tree06a9501db57da83b43466a68531fde7160258edd /src/dedo.go
parentsrc/dedo.go: Move implementation of Tx public methods into private functions (diff)
downloaddedo-e71d5f9df58d23f9ede7bfad6008a1b93d7bd732.tar.gz
dedo-e71d5f9df58d23f9ede7bfad6008a1b93d7bd732.tar.xz
src/dedo.go: Remove *cursorT appearance from public API
Diffstat (limited to 'src/dedo.go')
-rw-r--r--src/dedo.go11
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)
}