MCPcopy
hub / github.com/etcd-io/bbolt / seek

Method seek

cursor.go:159–166  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
159func (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.
169func (c *Cursor) goToFirstElementOnTheStack() {

Callers 10

SeekMethod · 0.95
BucketMethod · 0.80
CreateBucketMethod · 0.80
DeleteBucketMethod · 0.80
MoveBucketMethod · 0.80
GetMethod · 0.80
PutMethod · 0.80
DeleteMethod · 0.80
spillMethod · 0.80

Calls 3

searchMethod · 0.95
keyValueMethod · 0.95
RootPageMethod · 0.80

Tested by

no test coverage detected