seek moves the cursor to a given key and returns it. If the key does not exist then the next key is used.
(seek []byte)
| 157 | // seek moves the cursor to a given key and returns it. |
| 158 | // If the key does not exist then the next key is used. |
| 159 | func (c *Cursor) seek(seek []byte) (key []byte, value []byte, flags uint32) { |
| 160 | // Start from root page/node and traverse to correct page. |
| 161 | c.stack = c.stack[:0] |
| 162 | c.search(seek, c.bucket.RootPage()) |
| 163 | |
| 164 | // If this is a bucket then return a nil value. |
| 165 | return c.keyValue() |
| 166 | } |
| 167 | |
| 168 | // first moves the cursor to the first leaf element under the last page in the stack. |
| 169 | func (c *Cursor) goToFirstElementOnTheStack() { |
no test coverage detected