restic/internal/migrations/interface.go
Michael Eischer c1bbbcd0dc migrate: Allow migrations to request a check run
This is currently only used by upgrade_repo_v2.
2022-05-09 22:31:30 +02:00

27 lines
567 B
Go

package migrations
import (
"context"
"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
// Name returns a short name.
Name() string
// Descr returns a description what the migration does.
Desc() string
}