MCPcopy
hub / github.com/rclone/rclone / rcBisync

Function rcBisync

cmd/bisync/rc.go:64–196  ·  view source on GitHub ↗
(ctx context.Context, in rc.Params)

Source from the content-addressed store, hash-verified

62}
63
64func rcBisync(ctx context.Context, in rc.Params) (out rc.Params, err error) {
65 opt := &Options{}
66 octx, ci := fs.AddConfig(ctx)
67
68 if dryRun, err := in.GetBool("dryRun"); err == nil {
69 ci.DryRun = dryRun
70 opt.DryRun = dryRun
71 } else if rc.NotErrParamNotFound(err) {
72 return nil, err
73 }
74
75 if maxDelete, err := in.GetInt64("maxDelete"); err == nil {
76 if maxDelete < 0 || maxDelete > 100 {
77 return nil, rc.NewErrParamInvalid(errors.New("maxDelete must be a percentage between 0 and 100"))
78 }
79 opt.MaxDelete = int(maxDelete)
80 } else if rc.NotErrParamNotFound(err) {
81 return nil, err
82 }
83
84 if opt.Resync, err = in.GetBool("resync"); rc.NotErrParamNotFound(err) {
85 fs.Debugf("resync", "optional parameter is missing. using default value: %v", opt.Resync)
86 }
87 if opt.CheckAccess, err = in.GetBool("checkAccess"); rc.NotErrParamNotFound(err) {
88 fs.Debugf("checkAccess", "optional parameter is missing. using default value: %v", opt.CheckAccess)
89 }
90 if opt.Force, err = in.GetBool("force"); rc.NotErrParamNotFound(err) {
91 fs.Debugf("force", "optional parameter is missing. using default value: %v", opt.Force)
92 }
93 if opt.CreateEmptySrcDirs, err = in.GetBool("createEmptySrcDirs"); rc.NotErrParamNotFound(err) {
94 fs.Debugf("createEmptySrcDirs", "optional parameter is missing. using default value: %v", opt.CreateEmptySrcDirs)
95 }
96 if opt.RemoveEmptyDirs, err = in.GetBool("removeEmptyDirs"); rc.NotErrParamNotFound(err) {
97 fs.Debugf("removeEmptyDirs", "optional parameter is missing. using default value: %v", opt.RemoveEmptyDirs)
98 }
99 if opt.NoCleanup, err = in.GetBool("noCleanup"); rc.NotErrParamNotFound(err) {
100 fs.Debugf("noCleanup", "optional parameter is missing. using default value: %v", opt.NoCleanup)
101 }
102 if opt.IgnoreListingChecksum, err = in.GetBool("ignoreListingChecksum"); rc.NotErrParamNotFound(err) {
103 fs.Debugf("ignoreListingChecksum", "optional parameter is missing. using default value: %v", opt.IgnoreListingChecksum)
104 }
105 if opt.Resilient, err = in.GetBool("resilient"); rc.NotErrParamNotFound(err) {
106 fs.Debugf("resilient", "optional parameter is missing. using default value: %v", opt.Resilient)
107 }
108 if opt.CheckFilename, err = in.GetString("checkFilename"); rc.NotErrParamNotFound(err) {
109 opt.CheckFilename = DefaultCheckFilename
110 fs.Debugf("checkFilename", "optional parameter is missing. using default value: %v", opt.CheckFilename)
111 }
112 if opt.FiltersFile, err = in.GetString("filtersFile"); rc.NotErrParamNotFound(err) {
113 fs.Debugf("filtersFile", "optional parameter is missing. using default value: %v", opt.FiltersFile)
114 }
115 if opt.Workdir, err = in.GetString("workdir"); rc.NotErrParamNotFound(err) {
116 // "" sets correct default later
117 fs.Debugf("workdir", "optional parameter is missing. using default value: %v", opt.Workdir)
118 }
119 if opt.BackupDir1, err = in.GetString("backupDir1"); rc.NotErrParamNotFound(err) {
120 // we accept an alternate capitalization here for backward compatibility.
121 if opt.BackupDir1, err = in.GetString("backupdir1"); rc.NotErrParamNotFound(err) {

Callers

nothing calls this directly

Calls 15

AddConfigFunction · 0.92
NotErrParamNotFoundFunction · 0.92
NewErrParamInvalidFunction · 0.92
DebugfFunction · 0.92
GetFsNamedFunction · 0.92
CaptureOutputFunction · 0.92
BasePathFunction · 0.92
SessionNameFunction · 0.92
setEnumFunction · 0.85
BisyncFunction · 0.85
GetBoolMethod · 0.80
GetInt64Method · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…