Middle layer wiring for verify command

This commit is contained in:
Ashlie Martinez 2024-01-12 12:09:00 -08:00
parent 651714fb4c
commit 7b0171cdd1
2 changed files with 15 additions and 0 deletions

View File

@ -746,3 +746,12 @@ func (w *Wrapper) UpdatePersistentConfig(
) error { ) error {
return clues.Stack(w.c.updatePersistentConfig(ctx, config)).OrNil() return clues.Stack(w.c.updatePersistentConfig(ctx, config)).OrNil()
} }
func (w *Wrapper) VerifyBackups(
ctx context.Context,
storer store.Storer,
) error {
return clues.Wrap(
verifyBackups(ctx, storer, w.c),
"verifying completeness of backups").OrNil()
}

View File

@ -53,6 +53,7 @@ type Backuper interface {
failOnMissing bool, failOnMissing bool,
ids ...string, ids ...string,
) error ) error
VerifyBackups(ctx context.Context) error
} }
// NewBackup generates a BackupOperation runner. // NewBackup generates a BackupOperation runner.
@ -356,3 +357,8 @@ func deleteBackups(
return sw.DeleteWithModelStoreIDs(ctx, toDelete...) return sw.DeleteWithModelStoreIDs(ctx, toDelete...)
} }
func (r repository) VerifyBackups(ctx context.Context) error {
return clues.Stack(r.dataLayer.VerifyBackups(ctx, store.NewWrapper(r.modelStore))).
OrNil()
}