mirror of
https://github.com/restic/restic.git
synced 2025-10-09 13:49:58 +00:00
repair pack: extract the repair logic into the repository package
Currently, the cmd/restic package contains a significant amount of code that modifies repository internals. This code should in the mid-term move into the repository package.
This commit is contained in:
30
internal/ui/progress/printer.go
Normal file
30
internal/ui/progress/printer.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package progress
|
||||
|
||||
// A Printer can can return a new counter or print messages
|
||||
// at different log levels.
|
||||
// It must be safe to call its methods from concurrent goroutines.
|
||||
type Printer interface {
|
||||
NewCounter(description string) *Counter
|
||||
|
||||
E(msg string, args ...interface{})
|
||||
P(msg string, args ...interface{})
|
||||
V(msg string, args ...interface{})
|
||||
VV(msg string, args ...interface{})
|
||||
}
|
||||
|
||||
// NoopPrinter discards all messages
|
||||
type NoopPrinter struct{}
|
||||
|
||||
var _ Printer = (*NoopPrinter)(nil)
|
||||
|
||||
func (*NoopPrinter) NewCounter(description string) *Counter {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (*NoopPrinter) E(msg string, args ...interface{}) {}
|
||||
|
||||
func (*NoopPrinter) P(msg string, args ...interface{}) {}
|
||||
|
||||
func (*NoopPrinter) V(msg string, args ...interface{}) {}
|
||||
|
||||
func (*NoopPrinter) VV(msg string, args ...interface{}) {}
|
Reference in New Issue
Block a user