aboutsummaryrefslogtreecommitdiff
path: root/src/dedo.go
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2025-02-09 18:03:36 -0300
committerEuAndreh <eu@euandre.org>2025-02-09 18:04:07 -0300
commitaf8dc56798dce5d14587b62a50cd618a63f8fb08 (patch)
tree6672ba5d7643ea278654d39ceb0421773873e460 /src/dedo.go
parentsrc/dedo.go: Simple renames - beginRWTx->beginTransaction, beginTx->beginSnap... (diff)
downloaddedo-af8dc56798dce5d14587b62a50cd618a63f8fb08.tar.gz
dedo-af8dc56798dce5d14587b62a50cd618a63f8fb08.tar.xz
src/dedo.go: Move transactionT to the beginning of the file
Diffstat (limited to 'src/dedo.go')
-rw-r--r--src/dedo.go36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/dedo.go b/src/dedo.go
index 734b384..2bb805e 100644
--- a/src/dedo.go
+++ b/src/dedo.go
@@ -91,6 +91,24 @@ type DatabaseI interface{
Path() string
}
+/// transactionT represents a read-only or read/write transaction on the
+/// database. Read-only transactions can be used for retrieving values for keys
+/// and creating cursors. Read/write transactions can create and remove buckets
+/// and create and remove keys.
+///
+/// IMPORTANT: You must commit or rollback transactions when you are done with
+/// them. Pages can not be reclaimed by the writer until no more transactions
+/// are using them. A long running read transaction can cause the database to
+/// quickly grow.
+type transactionT struct{
+ writable bool
+ db *DB
+ meta *meta
+ root Bucket
+ pages map[pgid]*page
+ commitHandlers []func()
+}
+
type pgid uint64
/// bucket represents the on-file representation of a bucket. This is stored as
@@ -295,24 +313,6 @@ type pgids []pgid
/// txid represents the internal transaction identifier.
type txid uint64
-/// transactionT represents a read-only or read/write transaction on the database.
-/// Read-only transactions can be used for retrieving values for keys and
-/// creating cursors. Read/write transactions can create and remove buckets
-/// and create and remove keys.
-///
-/// IMPORTANT: You must commit or rollback transactions when you are done with
-/// them. Pages can not be reclaimed by the writer until no more transactions
-/// are using them. A long running read transaction can cause the database to
-/// quickly grow.
-type transactionT struct {
- writable bool
- db *DB
- meta *meta
- root Bucket
- pages map[pgid]*page
- commitHandlers []func()
-}
-
/// walkFunc is the type of the function called for keys (buckets and "normal"
/// values) discovered by Walk. Keys is the list of keys to descend to the
/// bucket owning the discovered key/value pair k/v.