checker

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2015 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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 *repository.Repository) *Checker

New returns a new checker which runs on repo.

func (*Checker) LoadIndex

func (c *Checker) LoadIndex() error

LoadIndex loads all index files.

func (*Checker) OrphanedPacks

func (c *Checker) OrphanedPacks() backend.IDs

OrphanedPacks returns a slice of unused packs (only available after Packs() was run).

func (*Checker) Packs

func (c *Checker) Packs(errChan chan<- error, done <-chan struct{})

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) Structure

func (c *Checker) Structure(errChan chan<- error, done <-chan struct{})

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() (blobs backend.IDs)

UnusedBlobs returns all blobs that have never been referenced.

type Error

type Error struct {
	TreeID *backend.ID
	BlobID *backend.ID
	Err    error
}

Error is an error that occurred while checking a repository.

func (Error) Error

func (e Error) Error() string

type PackError

type PackError struct {
	ID       backend.ID
	Orphaned bool
	Err      error
}

PackError describes an error with a specific pack.

func (PackError) Error

func (e PackError) Error() string

type TreeError

type TreeError struct {
	ID     backend.ID
	Errors []error
}

TreeError is returned when loading a tree from the repository failed.

func (TreeError) Error

func (e TreeError) Error() string

Jump to

Keyboard shortcuts

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