mirror of https://github.com/restic/restic.git
Rename Index interface to MasterIndex
The interface is now only implemented by repository.MasterIndex.
This commit is contained in:
parent
9d1fb94c6c
commit
c847aace35
|
@ -11,7 +11,7 @@ import (
|
|||
// Saver allows saving a blob.
|
||||
type Saver interface {
|
||||
SaveBlob(ctx context.Context, t restic.BlobType, data []byte, id restic.ID, storeDuplicate bool) (restic.ID, bool, error)
|
||||
Index() restic.Index
|
||||
Index() restic.MasterIndex
|
||||
}
|
||||
|
||||
// BlobSaver concurrently saves incoming blobs to the repo.
|
||||
|
|
|
@ -16,7 +16,7 @@ import (
|
|||
var errTest = errors.New("test error")
|
||||
|
||||
type saveFail struct {
|
||||
idx restic.Index
|
||||
idx restic.MasterIndex
|
||||
cnt int32
|
||||
failAt int32
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ func (b *saveFail) SaveBlob(ctx context.Context, t restic.BlobType, buf []byte,
|
|||
return id, false, nil
|
||||
}
|
||||
|
||||
func (b *saveFail) Index() restic.Index {
|
||||
func (b *saveFail) Index() restic.MasterIndex {
|
||||
return b.idx
|
||||
}
|
||||
|
||||
|
|
|
@ -355,12 +355,12 @@ func (r *Repository) Backend() restic.Backend {
|
|||
}
|
||||
|
||||
// Index returns the currently used MasterIndex.
|
||||
func (r *Repository) Index() restic.Index {
|
||||
func (r *Repository) Index() restic.MasterIndex {
|
||||
return r.idx
|
||||
}
|
||||
|
||||
// SetIndex instructs the repository to use the given index.
|
||||
func (r *Repository) SetIndex(i restic.Index) error {
|
||||
func (r *Repository) SetIndex(i restic.MasterIndex) error {
|
||||
r.idx = i.(*MasterIndex)
|
||||
|
||||
ids := restic.NewIDSet()
|
||||
|
|
|
@ -15,9 +15,9 @@ type Repository interface {
|
|||
|
||||
Key() *crypto.Key
|
||||
|
||||
SetIndex(Index) error
|
||||
SetIndex(MasterIndex) error
|
||||
|
||||
Index() Index
|
||||
Index() MasterIndex
|
||||
SaveFullIndex(context.Context) error
|
||||
SaveIndex(context.Context) error
|
||||
LoadIndex(context.Context) error
|
||||
|
@ -57,8 +57,8 @@ type Lister interface {
|
|||
List(context.Context, FileType, func(FileInfo) error) error
|
||||
}
|
||||
|
||||
// Index keeps track of the blobs are stored within files.
|
||||
type Index interface {
|
||||
// MasterIndex keeps track of the blobs are stored within files.
|
||||
type MasterIndex interface {
|
||||
Has(ID, BlobType) bool
|
||||
Lookup(ID, BlobType) []PackedBlob
|
||||
Count(BlobType) uint
|
||||
|
|
Loading…
Reference in New Issue