From 63a8cddd2bdc0b27e9174609a8bb8bcf0288f091 Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Wed, 16 Apr 2014 09:38:53 -0400 Subject: Add Cursor.Bucket() function. This commit adds an accessor to the Cursor type to retrieve the Bucket that it was created from. --- cursor.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cursor.go') 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) { -- cgit v1.2.3