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

Function walkBucket

cmd/bbolt/command/utils_test.go:134–149  ·  view source on GitHub ↗
(parent *bolt.Bucket, k []byte, v []byte, w io.Writer)

Source from the content-addressed store, hash-verified

132}
133
134func walkBucket(parent *bolt.Bucket, k []byte, v []byte, w io.Writer) error {
135 if _, err := fmt.Fprintf(w, "%d:%x=%x\n", parent.Sequence(), k, v); err != nil {
136 return err
137 }
138
139 // not a bucket, exit.
140 if v != nil {
141 return nil
142 }
143 return parent.ForEach(func(k, v []byte) error {
144 if v == nil {
145 return walkBucket(parent.Bucket(k), k, nil, w)
146 }
147 return walkBucket(parent, k, v, w)
148 })
149}
150
151func dbData(t *testing.T, filePath string) []byte {
152 data, err := os.ReadFile(filePath)

Callers 1

chkdbFunction · 0.70

Calls 3

SequenceMethod · 0.80
ForEachMethod · 0.45
BucketMethod · 0.45

Tested by

no test coverage detected