(ctx context.Context, dst blob.Storage)
| 176 | } |
| 177 | |
| 178 | func (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 | |
| 198 | func (c *commandRepositorySyncTo) beginSyncProgress() { |
| 199 | c.lastSyncProgress = "" |
no test coverage detected