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

Method MoveBucket

tx.go:143–151  ·  view source on GitHub ↗

MoveBucket moves a sub-bucket from the source bucket to the destination bucket. Returns an error if 1. the sub-bucket cannot be found in the source bucket; 2. or the key already exists in the destination bucket; 3. the key represents a non-bucket value. If src is nil, it means moving a top level bu

(child []byte, src *Bucket, dst *Bucket)

Source from the content-addressed store, hash-verified

141// If src is nil, it means moving a top level bucket into the target bucket.
142// If dst is nil, it means converting the child bucket into a top level bucket.
143func (tx *Tx) MoveBucket(child []byte, src *Bucket, dst *Bucket) error {
144 if src == nil {
145 src = &tx.root
146 }
147 if dst == nil {
148 dst = &tx.root
149 }
150 return src.MoveBucket(child, dst)
151}
152
153// ForEach executes a function for each bucket in the root.
154// If the provided function returns an error then the iteration is stopped and

Callers 1

TestTx_MoveBucketFunction · 0.45

Calls

no outgoing calls

Tested by 1

TestTx_MoveBucketFunction · 0.36