mirror of
https://github.com/restic/restic.git
synced 2026-09-20 11:08:30 +00:00
restic: move Printer interface from internal/ui/progress
Move Printer and NewNoopPrinter to internal/restic so repository does not have to import the ui packages.
This commit is contained in:
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
// jsonProgress reports progress for the `backup` command in JSON.
|
||||
type jsonProgress struct {
|
||||
progress.Printer
|
||||
restic.Printer
|
||||
|
||||
term ui.Terminal
|
||||
v uint
|
||||
|
||||
@@ -21,7 +21,7 @@ type ProgressPrinter interface {
|
||||
Finish(snapshotID restic.ID, summary *archiver.Summary, dryRun bool)
|
||||
Reset()
|
||||
|
||||
progress.Printer
|
||||
restic.Printer
|
||||
}
|
||||
|
||||
type Counter struct {
|
||||
|
||||
@@ -8,12 +8,11 @@ import (
|
||||
"github.com/restic/restic/internal/archiver"
|
||||
"github.com/restic/restic/internal/data"
|
||||
"github.com/restic/restic/internal/restic"
|
||||
"github.com/restic/restic/internal/ui/progress"
|
||||
)
|
||||
|
||||
type mockPrinter struct {
|
||||
sync.Mutex
|
||||
progress.Printer
|
||||
restic.Printer
|
||||
dirUnchanged, fileNew bool
|
||||
id restic.ID
|
||||
}
|
||||
@@ -48,7 +47,7 @@ func (p *mockPrinter) Reset() {}
|
||||
func TestProgress(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
prnt := &mockPrinter{Printer: progress.NewNoopPrinter()}
|
||||
prnt := &mockPrinter{Printer: restic.NewNoopPrinter()}
|
||||
prog := newProgress(prnt, time.Millisecond)
|
||||
|
||||
prog.StartFile("foo")
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
|
||||
// textProgress reports progress for the `backup` command.
|
||||
type textProgress struct {
|
||||
progress.Printer
|
||||
restic.Printer
|
||||
|
||||
term ui.Terminal
|
||||
verbosity uint
|
||||
|
||||
Reference in New Issue
Block a user