MCPcopy
hub / github.com/rclone/rclone / restoreStatus

Method restoreStatus

backend/s3/s3.go:3587–3624  ·  view source on GitHub ↗

Recursively enumerate the current fs to find objects with a restore status

(ctx context.Context, all bool)

Source from the content-addressed store, hash-verified

3585
3586// Recursively enumerate the current fs to find objects with a restore status
3587func (f *Fs) restoreStatus(ctx context.Context, all bool) (out []restoreStatusOut, err error) {
3588 fs.Debugf(f, "all = %v", all)
3589 bucket, directory := f.split("")
3590 out = []restoreStatusOut{}
3591 err = f.list(ctx, listOpt{
3592 bucket: bucket,
3593 directory: directory,
3594 prefix: f.rootDirectory,
3595 addBucket: f.rootBucket == "",
3596 recurse: true,
3597 withVersions: f.opt.Versions,
3598 versionAt: f.opt.VersionAt,
3599 hidden: f.opt.VersionDeleted,
3600 restoreStatus: true,
3601 }, func(remote string, object *types.Object, versionID *string, isDirectory bool) error {
3602 entry, err := f.itemToDirEntry(ctx, remote, object, versionID, isDirectory)
3603 if err != nil {
3604 return err
3605 }
3606 if entry != nil {
3607 if o, ok := entry.(*Object); ok && (all || object.RestoreStatus != nil) {
3608 out = append(out, restoreStatusOut{
3609 Remote: o.remote,
3610 VersionID: o.versionID,
3611 RestoreStatus: object.RestoreStatus,
3612 StorageClass: object.StorageClass,
3613 })
3614 }
3615 }
3616 return nil
3617 })
3618 if err != nil {
3619 return nil, err
3620 }
3621 // bucket must be present if listing succeeded
3622 f.cache.MarkOK(bucket)
3623 return out, nil
3624}
3625
3626// listMultipartUploads lists all outstanding multipart uploads for (bucket, key)
3627//

Callers 1

CommandMethod · 0.95

Calls 5

splitMethod · 0.95
listMethod · 0.95
itemToDirEntryMethod · 0.95
DebugfFunction · 0.92
MarkOKMethod · 0.80

Tested by

no test coverage detected