type Cursor … // Bucket returns the bucket that this cursor was created from. func (c *Cursor) Bucket() *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. // The returned key and value are only valid for the life of the transaction. func (c *Cursor) First() (key []byte, value []byte) { … } func (c *Cursor) first() (key []byte, value []byte, flags uint32) { … } // Last moves the cursor to the last item in the bucket and returns its key and value. // If the bucket is empty then a nil key and value are returned. // The returned key and value are only valid for the life of the transaction. func (c *Cursor) Last() (key []byte, value []byte) { … } // Next moves the cursor to the next item in the bucket and returns its key and value. // If the cursor is at the end of the bucket then a nil key and value are returned. // The returned key and value are only valid for the life of the transaction. func (c *Cursor) Next() (key []byte, value []byte) { … } // Prev moves the cursor to the previous item in the bucket and returns its key and value. // If the cursor is at the beginning of the bucket then a nil key and value are returned. // The returned key and value are only valid for the life of the transaction. func (c *Cursor) Prev() (key []byte, value []byte) { … } // Seek moves the cursor to a given key using a b-tree search and returns it. // If the key does not exist then the next key is used. If no keys // follow, a nil key is returned. // The returned key and value are only valid for the life of the transaction. func (c *Cursor) Seek(seek []byte) (key []byte, value []byte) { … } // Delete removes the current key/value under the cursor from the bucket. // Delete fails if current key/value is a bucket or if the transaction is not writable. func (c *Cursor) Delete() error { … } // seek moves the cursor to a given key and returns it. // If the key does not exist then the next key is used. func (c *Cursor) seek(seek []byte) (key []byte, value []byte, flags uint32) { … } // first moves the cursor to the first leaf element under the last page in the stack. func (c *Cursor) goToFirstElementOnTheStack() { … } // last moves the cursor to the last leaf element under the last page in the stack. func (c *Cursor) last() { … } // next moves to the next leaf element and returns the key and value. // If the cursor is at the last leaf element then it stays there and returns nil. func (c *Cursor) next() (key []byte, value []byte, flags uint32) { … } // prev moves the cursor to the previous item in the bucket and returns its key and value. // If the cursor is at the beginning of the bucket then a nil key and value are returned. func (c *Cursor) prev() (key []byte, value []byte, flags uint32) { … } // search recursively performs a binary search against a given page/node until it finds a given key. func (c *Cursor) search(key []byte, pgId pgid) { … } func (c *Cursor) searchNode(key []byte, n *node) { … } func (c *Cursor) searchPage(key []byte, p *page) { … } // nsearch searches the leaf node on the top of the stack for a key. func (c *Cursor) nsearch(key []byte) { … } // keyValue returns the key and value of the current leaf element. func (c *Cursor) keyValue() ([]byte, []byte, uint32) { … } // node returns the node that the cursor is currently positioned on. func (c *Cursor) node() *node { … } type elemRef … // isLeaf returns whether the ref is pointing at a leaf page/node. func (r *elemRef) isLeaf() bool { … } // count returns the number of inodes or page elements. func (r *elemRef) count() int { … }