diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2014-04-16 09:38:53 -0400 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2014-04-16 09:38:53 -0400 |
commit | 63a8cddd2bdc0b27e9174609a8bb8bcf0288f091 (patch) | |
tree | 85a7dd3971047fc8c13e0c1ceb0b93517476bf04 /cursor.go | |
parent | Merge pull request #130 from benbjohnson/create-bucket-api (diff) | |
download | dedo-63a8cddd2bdc0b27e9174609a8bb8bcf0288f091.tar.gz dedo-63a8cddd2bdc0b27e9174609a8bb8bcf0288f091.tar.xz |
Add Cursor.Bucket() function.
This commit adds an accessor to the Cursor type to retrieve the Bucket that
it was created from.
Diffstat (limited to 'cursor.go')
-rw-r--r-- | cursor.go | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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) { |