mirror of
https://github.com/restic/restic.git
synced 2026-11-22 05:14:23 +00:00
repository: deduplicate index progress bar initializaton
This commit is contained in:
1 parent
b459d66288
commit
52eb66929f
21 files changed
+41
-48
No files matched your search
@@ -21,7 +21,7 @@ type Repository interface {
|
||||
Config() Config
|
||||
Key() *crypto.Key
|
||||
|
||||
LoadIndex(ctx context.Context, p *progress.Counter) error
|
||||
LoadIndex(ctx context.Context, p TerminalCounterFactory) error
|
||||
SetIndex(mi MasterIndex) error
|
||||
|
||||
LookupBlob(t BlobType, id ID) []PackedBlob
|
||||
@@ -131,6 +131,12 @@ type PackBlobs struct {
|
||||
Blobs []Blob
|
||||
}
|
||||
|
||||
type TerminalCounterFactory interface {
|
||||
// NewCounterTerminalOnly returns a new progress counter that is only shown if stdout points to a
|
||||
// terminal. It is not shown if --quiet or --json is specified.
|
||||
NewCounterTerminalOnly(description string) *progress.Counter
|
||||
}
|
||||
|
||||
// MasterIndex keeps track of the blobs are stored within files.
|
||||
type MasterIndex interface {
|
||||
Has(bh BlobHandle) bool
|
||||
|
||||
Reference in new issue
Block a user