MCPcopy
hub / github.com/kopia/kopia / getSourcesToMigrate

Method getSourcesToMigrate

cli/command_snapshot_migrate.go:316–338  ·  view source on GitHub ↗
(ctx context.Context, rep repo.Repository)

Source from the content-addressed store, hash-verified

314}
315
316func (c *commandSnapshotMigrate) getSourcesToMigrate(ctx context.Context, rep repo.Repository) ([]snapshot.SourceInfo, error) {
317 if len(c.migrateSources) > 0 {
318 var result []snapshot.SourceInfo
319
320 for _, s := range c.migrateSources {
321 si, err := snapshot.ParseSourceInfo(s, rep.ClientOptions().Hostname, rep.ClientOptions().Username)
322 if err != nil {
323 return nil, errors.Wrapf(err, "unable to parse %q", s)
324 }
325
326 result = append(result, si)
327 }
328
329 return result, nil
330 }
331
332 if c.migrateAll {
333 //nolint:wrapcheck
334 return snapshot.ListSources(ctx, rep)
335 }
336
337 return nil, errors.New("must specify either --all or --sources")
338}

Callers 1

runMethod · 0.95

Calls 3

ParseSourceInfoFunction · 0.92
ListSourcesFunction · 0.92
ClientOptionsMethod · 0.65

Tested by

no test coverage detected