mirror of
https://github.com/restic/restic.git
synced 2026-08-06 05:33:17 +00:00
repository: expose AssociatedBlobSet via repository interface
This commit is contained in:
@@ -787,6 +787,22 @@ func (r *Repository) createIndexFromPacks(ctx context.Context, packsize map[rest
|
||||
return invalid, nil
|
||||
}
|
||||
|
||||
func (r *Repository) NewAssociatedBlobSet() restic.AssociatedBlobSet {
|
||||
return &associatedBlobSet{*index.NewAssociatedSet[struct{}](r.idx)}
|
||||
}
|
||||
|
||||
// associatedBlobSet is a wrapper around index.AssociatedSet to implement the restic.AssociatedBlobSet interface.
|
||||
type associatedBlobSet struct {
|
||||
index.AssociatedSet[struct{}]
|
||||
}
|
||||
|
||||
func (s *associatedBlobSet) Intersect(other restic.AssociatedBlobSet) restic.AssociatedBlobSet {
|
||||
return &associatedBlobSet{*s.AssociatedSet.Intersect(other)}
|
||||
}
|
||||
func (s *associatedBlobSet) Sub(other restic.AssociatedBlobSet) restic.AssociatedBlobSet {
|
||||
return &associatedBlobSet{*s.AssociatedSet.Sub(other)}
|
||||
}
|
||||
|
||||
// prepareCache initializes the local cache. indexIDs is the list of IDs of
|
||||
// index files still present in the repo.
|
||||
func (r *Repository) prepareCache() error {
|
||||
|
||||
Reference in New Issue
Block a user