MCPcopy
hub / github.com/kopia/kopia / deleteSnapshot

Method deleteSnapshot

cli/command_snapshot_delete.go:84–95  ·  view source on GitHub ↗
(ctx context.Context, rep repo.RepositoryWriter, m *snapshot.Manifest)

Source from the content-addressed store, hash-verified

82}
83
84func (c *commandSnapshotDelete) deleteSnapshot(ctx context.Context, rep repo.RepositoryWriter, m *snapshot.Manifest) error {
85 desc := fmt.Sprintf("snapshot %v of %v at %v", m.ID, m.Source, formatTimestamp(m.StartTime.ToTime()))
86
87 if !c.snapshotDeleteConfirm {
88 log(ctx).Infof("Would delete %v (pass --delete to confirm)", desc)
89 return nil
90 }
91
92 log(ctx).Infof("Deleting %v...", desc)
93
94 return errors.Wrap(rep.DeleteManifest(ctx, m.ID), "error deleting manifest")
95}
96
97func (c *commandSnapshotDelete) deleteSnapshotsByRootObjectID(ctx context.Context, rep repo.RepositoryWriter, rootID string) error {
98 rootOID, err := object.ParseID(rootID)

Callers 3

runMethod · 0.95
snapshotDeleteSourcesMethod · 0.95

Calls 3

formatTimestampFunction · 0.85
ToTimeMethod · 0.80
DeleteManifestMethod · 0.65

Tested by

no test coverage detected