MCPcopy
hub / github.com/kopia/kopia / listDestinationBlobs

Method listDestinationBlobs

cli/command_repository_sync.go:178–196  ·  view source on GitHub ↗
(ctx context.Context, dst blob.Storage)

Source from the content-addressed store, hash-verified

176}
177
178func (c *commandRepositorySyncTo) listDestinationBlobs(ctx context.Context, dst blob.Storage) (map[blob.ID]blob.Metadata, error) {
179 dstTotalBytes := int64(0)
180 dstMetadata := map[blob.ID]blob.Metadata{}
181
182 c.beginSyncProgress()
183
184 if err := dst.ListBlobs(ctx, "", func(bm blob.Metadata) error {
185 dstMetadata[bm.BlobID] = bm
186 dstTotalBytes += bm.Length
187 c.outputSyncProgress(fmt.Sprintf(" Found %v BLOBs in the destination repository (%v)", len(dstMetadata), units.BytesString(dstTotalBytes)))
188 return nil
189 }); err != nil {
190 return nil, errors.Wrap(err, "error listing BLOBs in destination repository")
191 }
192
193 c.finishSyncProcess()
194
195 return dstMetadata, nil
196}
197
198func (c *commandRepositorySyncTo) beginSyncProgress() {
199 c.lastSyncProgress = ""

Callers 1

runSyncWithStorageMethod · 0.95

Calls 5

beginSyncProgressMethod · 0.95
outputSyncProgressMethod · 0.95
finishSyncProcessMethod · 0.95
BytesStringFunction · 0.92
ListBlobsMethod · 0.65

Tested by

no test coverage detected