MCPcopy Index your code
hub / github.com/kopia/kopia / setupUploader

Method setupUploader

cli/command_snapshot_create.go:229–266  ·  view source on GitHub ↗
(rep repo.RepositoryWriter)

Source from the content-addressed store, hash-verified

227}
228
229func (c *commandSnapshotCreate) setupUploader(rep repo.RepositoryWriter) *upload.Uploader {
230 u := upload.NewUploader(rep)
231 u.MaxUploadBytes = c.snapshotCreateCheckpointUploadLimitMB << 20 //nolint:mnd
232
233 if c.snapshotCreateForceEnableActions {
234 u.EnableActions = true
235 }
236
237 if c.snapshotCreateForceDisableActions {
238 u.EnableActions = false
239 }
240
241 if l := c.logDirDetail; l != -1 {
242 ld := policy.LogDetail(l)
243
244 u.OverrideDirLogDetail = &ld
245 }
246
247 if l := c.logEntryDetail; l != -1 {
248 ld := policy.LogDetail(l)
249
250 u.OverrideEntryLogDetail = &ld
251 }
252
253 if interval := c.snapshotCreateCheckpointInterval; interval != 0 {
254 u.CheckpointInterval = interval
255 }
256
257 c.svc.onTerminate(u.Cancel)
258
259 u.ForceHashPercentage = c.snapshotCreateForceHash
260 u.ParallelUploads = c.snapshotCreateParallelUploads
261
262 u.FailFast = c.snapshotCreateFailFast
263 u.Progress = c.svc.getProgress()
264
265 return u
266}
267
268func parseTimestamp(timestamp string) (time.Time, error) {
269 if timestamp == "" {

Callers 1

runMethod · 0.95

Calls 4

NewUploaderFunction · 0.92
LogDetailTypeAlias · 0.92
onTerminateMethod · 0.65
getProgressMethod · 0.65

Tested by

no test coverage detected