migrate: Allow migrations to request a check run
This is currently only used by upgrade_repo_v2.
This commit is contained in:
parent
59eb132dcd
commit
c1bbbcd0dc
4 changed files with 26 additions and 0 deletions
|
@ -6,11 +6,16 @@ import (
|
|||
"github.com/restic/restic/internal/restic"
|
||||
)
|
||||
|
||||
type RepositoryCheckOptions struct {
|
||||
}
|
||||
|
||||
// Migration implements a data migration.
|
||||
type Migration interface {
|
||||
// Check returns true if the migration can be applied to a repo.
|
||||
Check(context.Context, restic.Repository) (bool, error)
|
||||
|
||||
RepoCheckOptions() *RepositoryCheckOptions
|
||||
|
||||
// Apply runs the migration.
|
||||
Apply(context.Context, restic.Repository) error
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue