migrations

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2023 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package migrations contains migrations that can be applied to a repository and/or backend.

Index

Constants

This section is empty.

Variables

All contains all migrations.

Functions

This section is empty.

Types

type Migration

type Migration interface {
	// Check returns true if the migration can be applied to a repo. If the option is not applicable it can return a specific reason.
	Check(context.Context, restic.Repository) (bool, string, error)

	RepoCheck() bool

	// 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
}

Migration implements a data migration.

type S3Layout

type S3Layout struct{}

S3Layout migrates a repository on an S3 backend from the "s3legacy" to the "default" layout.

func (*S3Layout) Apply

func (m *S3Layout) Apply(ctx context.Context, repo restic.Repository) error

Apply runs the migration.

func (*S3Layout) Check

func (m *S3Layout) Check(_ context.Context, repo restic.Repository) (bool, string, error)

Check tests whether the migration can be applied.

func (*S3Layout) Desc

func (m *S3Layout) Desc() string

Desc returns a short description what the migration does.

func (*S3Layout) Name

func (m *S3Layout) Name() string

Name returns the name for this migration.

func (*S3Layout) RepoCheck

func (m *S3Layout) RepoCheck() bool

type UpgradeRepoV2

type UpgradeRepoV2 struct{}

func (*UpgradeRepoV2) Apply

func (m *UpgradeRepoV2) Apply(ctx context.Context, repo restic.Repository) error

func (*UpgradeRepoV2) Check

func (*UpgradeRepoV2) Desc

func (*UpgradeRepoV2) Desc() string

func (*UpgradeRepoV2) Name

func (*UpgradeRepoV2) Name() string

func (*UpgradeRepoV2) RepoCheck

func (*UpgradeRepoV2) RepoCheck() bool

type UpgradeRepoV2Error

type UpgradeRepoV2Error struct {
	UploadNewConfigError   error
	ReuploadOldConfigError error

	BackupFilePath string
}

func (*UpgradeRepoV2Error) Error

func (err *UpgradeRepoV2Error) Error() string

func (*UpgradeRepoV2Error) Unwrap

func (err *UpgradeRepoV2Error) Unwrap() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL