MCPcopy Create free account
hub / github.com/cloudreve/cloudreve / AppendStorageDiff

Method AppendStorageDiff

inventory/tx.go:30–41  ·  view source on GitHub ↗

AppendStorageDiff appends the given storage diff to the transaction.

(diff StorageDiff)

Source from the content-addressed store, hash-verified

28
29// AppendStorageDiff appends the given storage diff to the transaction.
30func (t *Tx) AppendStorageDiff(diff StorageDiff) {
31 root := t
32 for root.inherited {
33 root = root.parent
34 }
35
36 if root.storageDiff == nil {
37 root.storageDiff = diff
38 } else {
39 root.storageDiff.Merge(diff)
40 }
41}
42
43// WithTx wraps the given inventory client with a transaction.
44func WithTx[T TxOperator](ctx context.Context, c T) (T, *Tx, context.Context, error) {

Callers 8

DeleteMethod · 0.80
CompleteUploadMethod · 0.80
CreateEntityMethod · 0.80
createFileMethod · 0.80
DeleteMethod · 0.80
MoveOrCopyMethod · 0.80
setCurrentVersionMethod · 0.80
RecycleEntitiesMethod · 0.80

Calls 1

MergeMethod · 0.45

Tested by

no test coverage detected