Documentation ¶
Overview ¶
Package index contains various data structures for indexing content in a repository or backend.
Index ¶
- Variables
- func Save(ctx context.Context, repo restic.Repository, packs map[restic.ID][]restic.Blob, ...) (restic.ID, error)
- type Index
- func (idx *Index) AddPack(id restic.ID, size int64, entries []restic.Blob) error
- func (idx *Index) DuplicateBlobs() (dups restic.BlobSet)
- func (idx *Index) FindBlob(h restic.BlobHandle) (result []Location, err error)
- func (idx *Index) PacksForBlobs(blobs restic.BlobSet) (packs restic.IDSet)
- func (idx *Index) RemovePack(id restic.ID) error
- func (idx *Index) Save(ctx context.Context, repo restic.Repository, supersedes restic.IDs) (restic.ID, error)
- type Location
- type Pack
Constants ¶
This section is empty.
Variables ¶
var ErrBlobNotFound = errors.New("blob not found in index")
ErrBlobNotFound is return by FindBlob when the blob could not be found in the index.
Functions ¶
Types ¶
type Index ¶
Index contains information about blobs and packs stored in a repo.
func New ¶
func New(ctx context.Context, repo restic.Repository, ignorePacks restic.IDSet, p *restic.Progress) (idx *Index, invalidFiles restic.IDs, err error)
New creates a new index for repo from scratch. InvalidFiles contains all IDs of files that cannot be listed successfully.
func (*Index) AddPack ¶
AddPack adds a pack to the index. If this pack is already in the index, an error is returned.
func (*Index) DuplicateBlobs ¶
DuplicateBlobs returns a list of blobs that are stored more than once in the repo.
func (*Index) FindBlob ¶
func (idx *Index) FindBlob(h restic.BlobHandle) (result []Location, err error)
FindBlob returns a list of packs and positions the blob can be found in.
func (*Index) PacksForBlobs ¶
PacksForBlobs returns the set of packs in which the blobs are contained.
func (*Index) RemovePack ¶
RemovePack deletes a pack from the index.