aboutsummaryrefslogtreecommitdiff
path: root/bucket.go
diff options
context:
space:
mode:
Diffstat (limited to 'bucket.go')
-rw-r--r--bucket.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/bucket.go b/bucket.go
index f9c3566..39ab551 100644
--- a/bucket.go
+++ b/bucket.go
@@ -5,6 +5,8 @@ type bucketid uint32
type Bucket struct {
*bucket
name string
+ transaction Transaction,
+ cursors []*Cursor,
}
type bucket struct {
@@ -15,3 +17,21 @@ type bucket struct {
leafs pgid
entries uint64
}
+
+func (b *Bucket) Close() error {
+ // TODO: Close cursors.
+ return nil
+}
+
+func (b *Bucket) Cursor() (*Cursor, error) {
+ if b.transaction == nil {
+ return nil, InvalidBucketError
+ }
+
+ c := &Cursor{
+ bucket: b,
+ stack: make([]elem, 0),
+ }
+
+ return nil
+}