Documentation ¶
Index ¶
- func IsOrphanedPack(err error) bool
- func TestCheckRepo(t testing.TB, repo restic.Repository)
- type Checker
- func (c *Checker) CountPacks() uint64
- func (c *Checker) GetPacks() restic.IDSet
- func (c *Checker) LoadIndex(ctx context.Context) (hints []error, errs []error)
- func (c *Checker) Packs(ctx context.Context, errChan chan<- error)
- func (c *Checker) ReadData(ctx context.Context, p *restic.Progress, errChan chan<- error)
- func (c *Checker) ReadPacks(ctx context.Context, packs restic.IDSet, p *restic.Progress, ...)
- func (c *Checker) Structure(ctx context.Context, errChan chan<- error)
- func (c *Checker) UnusedBlobs() (blobs restic.IDs)
- type ErrDuplicatePacks
- type ErrOldIndexFormat
- type Error
- type PackError
- type TreeError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
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 (*Checker) CountPacks ¶
CountPacks returns the number of packs in the repository.
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 restic.IDSet, p *restic.Progress, 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 ¶
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 ErrOldIndexFormat ¶
ErrOldIndexFormat is returned when an index with the old format is found.
func (ErrOldIndexFormat) Error ¶
func (err ErrOldIndexFormat) Error() string