( ctx context.Context, srcurl *url.URL, dsturl *url.URL, isBatch bool, metadata map[string]string, )
| 617 | } |
| 618 | |
| 619 | func (c Copy) prepareUploadTask( |
| 620 | ctx context.Context, |
| 621 | srcurl *url.URL, |
| 622 | dsturl *url.URL, |
| 623 | isBatch bool, |
| 624 | metadata map[string]string, |
| 625 | ) func() error { |
| 626 | return func() error { |
| 627 | dsturl = prepareRemoteDestination(srcurl, dsturl, c.flatten, isBatch) |
| 628 | err := c.doUpload(ctx, srcurl, dsturl, metadata) |
| 629 | if err != nil { |
| 630 | return &errorpkg.Error{ |
| 631 | Op: c.op, |
| 632 | Src: srcurl, |
| 633 | Dst: dsturl, |
| 634 | Err: err, |
| 635 | } |
| 636 | } |
| 637 | c.progressbar.IncrementCompletedObjects() |
| 638 | return nil |
| 639 | } |
| 640 | } |
| 641 | |
| 642 | // doDownload is used to fetch a remote object and save as a local object. |
| 643 | func (c Copy) doDownload(ctx context.Context, srcurl *url.URL, dsturl *url.URL) error { |
no test coverage detected