aboutsummaryrefslogtreecommitdiff
path: root/cursor.go
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-04-16 09:40:30 -0400
committerBen Johnson <benbjohnson@yahoo.com>2014-04-16 09:40:30 -0400
commit6903c7447bfb817c1f9995be283b3301c6c1fb5c (patch)
tree85a7dd3971047fc8c13e0c1ceb0b93517476bf04 /cursor.go
parentMerge pull request #130 from benbjohnson/create-bucket-api (diff)
parentAdd Cursor.Bucket() function. (diff)
downloaddedo-6903c7447bfb817c1f9995be283b3301c6c1fb5c.tar.gz
dedo-6903c7447bfb817c1f9995be283b3301c6c1fb5c.tar.xz
Merge pull request #131 from benbjohnson/cursor-bucket
Add Cursor.Bucket() function.
Diffstat (limited to 'cursor.go')
-rw-r--r--cursor.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/cursor.go b/cursor.go
index f6dc79c..13f2a06 100644
--- a/cursor.go
+++ b/cursor.go
@@ -12,6 +12,11 @@ type Cursor struct {
stack []elemRef
}
+// Bucket returns the bucket that this cursor was created from.
+func (c *Cursor) Bucket() *Bucket {
+ return c.bucket
+}
+
// First moves the cursor to the first item in the bucket and returns its key and value.
// If the bucket is empty then a nil key and value are returned.
func (c *Cursor) First() (key []byte, value []byte) {