Documentation ¶
Index ¶
- Variables
- func IsOrphanedPack(err error) bool
- func TestCheckRepo(t testing.TB, repo restic.Repository)
- type Checker
- func (c *Checker) CountPacks() uint64
- func (c *Checker) GetPacks() map[restic.ID]int64
- func (c *Checker) LoadIndex(ctx context.Context) (hints []error, errs []error)
- func (c *Checker) LoadSnapshots(ctx context.Context) error
- func (c *Checker) Packs(ctx context.Context, errChan chan<- error)
- func (c *Checker) ReadData(ctx context.Context, errChan chan<- error)
- func (c *Checker) ReadPacks(ctx context.Context, packs map[restic.ID]int64, p *progress.Counter, ...)
- func (c *Checker) Structure(ctx context.Context, p *progress.Counter, errChan chan<- error)
- func (c *Checker) UnusedBlobs(ctx context.Context) (blobs restic.BlobHandles)
- type ErrDuplicatePacks
- type ErrMixedPack
- type ErrOldIndexFormat
- type Error
- type PackError
- type TreeError
Constants ¶
This section is empty.
Variables ¶
var ErrLegacyLayout = errors.New("repository uses S3 legacy layout")
ErrLegacyLayout is returned when the repository uses the S3 legacy layout.
Functions ¶
func IsOrphanedPack ¶ added in v0.9.0
IsOrphanedPack returns true if the error describes a pack which is not contained in any index.
func TestCheckRepo ¶
func TestCheckRepo(t testing.TB, repo restic.Repository)
TestCheckRepo runs the checker on repo.
Types ¶
type Checker ¶
type Checker struct {
// contains filtered or unexported fields
}
Checker runs various checks on a repository. It is advisable to create an exclusive Lock in the repository before running any checks.
A Checker only tests for internal errors within the data structures of the repository (e.g. missing blobs), and needs a valid Repository to work on.
func New ¶
func New(repo restic.Repository, trackUnused bool) *Checker
New returns a new checker which runs on repo.
func (*Checker) CountPacks ¶
CountPacks returns the number of packs in the repository.
func (*Checker) LoadSnapshots ¶ added in v0.14.0
func (*Checker) Packs ¶
Packs checks that all packs referenced in the index are still available and there are no packs that aren't in an index. errChan is closed after all packs have been checked.
func (*Checker) ReadPacks ¶ added in v0.8.3
func (c *Checker) ReadPacks(ctx context.Context, packs map[restic.ID]int64, p *progress.Counter, errChan chan<- error)
ReadPacks loads data from specified packs and checks the integrity.
func (*Checker) Structure ¶
Structure checks that for all snapshots all referenced data blobs and subtrees are available in the index. errChan is closed after all trees have been traversed.
func (*Checker) UnusedBlobs ¶
func (c *Checker) UnusedBlobs(ctx context.Context) (blobs restic.BlobHandles)
UnusedBlobs returns all blobs that have never been referenced.
type ErrDuplicatePacks ¶
ErrDuplicatePacks is returned when a pack is found in more than one index.
func (*ErrDuplicatePacks) Error ¶
func (e *ErrDuplicatePacks) Error() string
type ErrMixedPack ¶ added in v0.14.0
ErrMixedPack is returned when a pack is found that contains both tree and data blobs.
func (*ErrMixedPack) Error ¶ added in v0.14.0
func (e *ErrMixedPack) Error() string
type ErrOldIndexFormat ¶
ErrOldIndexFormat is returned when an index with the old format is found.
func (*ErrOldIndexFormat) Error ¶
func (err *ErrOldIndexFormat) Error() string