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

Method loadSourceManifests

cli/command_snapshot_verify.go:208–238  ·  view source on GitHub ↗
(ctx context.Context, rep repo.Repository)

Source from the content-addressed store, hash-verified

206}
207
208func (c *commandSnapshotVerify) loadSourceManifests(ctx context.Context, rep repo.Repository) ([]*snapshot.Manifest, error) {
209 var manifestIDs []manifest.ID
210
211 if c.noVerifyTargetArgsProvided() {
212 // User didn't specify any particular snapshot or snapshots to verify.
213 // Read out all manifests and verify everything.
214 man, err := snapshot.ListSnapshotManifests(ctx, rep, nil, nil)
215 if err != nil {
216 return nil, errors.Wrap(err, "unable to list snapshot manifests")
217 }
218
219 manifestIDs = append(manifestIDs, man...)
220 } else {
221 for _, srcStr := range c.verifyCommandSources {
222 src, err := snapshot.ParseSourceInfo(srcStr, rep.ClientOptions().Hostname, rep.ClientOptions().Username)
223 if err != nil {
224 return nil, errors.Wrapf(err, "error parsing %q", srcStr)
225 }
226
227 man, err := snapshot.ListSnapshotManifests(ctx, rep, &src, nil)
228 if err != nil {
229 return nil, errors.Wrapf(err, "unable to list snapshot manifests for %v", src)
230 }
231
232 manifestIDs = append(manifestIDs, man...)
233 }
234 }
235
236 //nolint:wrapcheck
237 return snapshot.LoadSnapshots(ctx, rep, manifestIDs)
238}
239
240// noVerifyTargetArgsProvided will return true if the user didn't specify any
241// particular snapshots to be verified, by any of the available means.

Callers 1

makeVerifyWalkerFuncMethod · 0.95

Calls 5

ListSnapshotManifestsFunction · 0.92
ParseSourceInfoFunction · 0.92
LoadSnapshotsFunction · 0.92
ClientOptionsMethod · 0.65

Tested by

no test coverage detected