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

Method recursivelyInspect

bucket.go:410–427  ·  view source on GitHub ↗
(name []byte)

Source from the content-addressed store, hash-verified

408}
409
410func (b *Bucket) recursivelyInspect(name []byte) BucketStructure {
411 bs := BucketStructure{Name: string(name)}
412
413 keyN := 0
414 c := b.Cursor()
415 for k, _, flags := c.first(); k != nil; k, _, flags = c.next() {
416 if flags&common.BucketLeafFlag != 0 {
417 childBucket := b.Bucket(k)
418 childBS := childBucket.recursivelyInspect(k)
419 bs.Children = append(bs.Children, childBS)
420 } else {
421 keyN++
422 }
423 }
424 bs.KeyN = keyN
425
426 return bs
427}
428
429// Get retrieves the value for a key in the bucket.
430// Returns a nil value if the key does not exist or if the key is a nested bucket.

Callers 1

InspectMethod · 0.95

Calls 4

CursorMethod · 0.95
BucketMethod · 0.95
firstMethod · 0.80
nextMethod · 0.80

Tested by

no test coverage detected