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

Function walk

compact.go:91–97  ·  view source on GitHub ↗

walk walks recursively the bolt database db, calling walkFn for each key it finds.

(db *DB, walkFn walkFunc)

Source from the content-addressed store, hash-verified

89
90// walk walks recursively the bolt database db, calling walkFn for each key it finds.
91func walk(db *DB, walkFn walkFunc) error {
92 return db.View(func(tx *Tx) error {
93 return tx.ForEach(func(name []byte, b *Bucket) error {
94 return walkBucket(b, nil, name, nil, b.Sequence(), walkFn)
95 })
96 })
97}
98
99func walkBucket(b *Bucket, keypath [][]byte, k, v []byte, seq uint64, fn walkFunc) error {
100 // Execute callback.

Callers 1

CompactFunction · 0.85

Calls 4

ViewMethod · 0.80
SequenceMethod · 0.80
walkBucketFunction · 0.70
ForEachMethod · 0.45

Tested by

no test coverage detected