MCPcopy
hub / github.com/restic/restic / Printer

Interface Printer

internal/ui/progress/printer.go:8–35  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

6// at different log levels.
7// It must be safe to call its methods from concurrent goroutines.
8type Printer interface {
9 // NewCounter returns a new progress counter. It is not shown if --quiet or --json is specified.
10 NewCounter(description string) *Counter
11 // NewCounterTerminalOnly returns a new progress counter that is only shown if stdout points to a
12 // terminal. It is not shown if --quiet or --json is specified.
13 NewCounterTerminalOnly(description string) *Counter
14
15 // E reports an error. This message is always printed to stderr.
16 // Appends a newline if not present.
17 E(msg string, args ...interface{})
18 // S prints a message, this is should only be used for very important messages
19 // that are not errors. The message is even printed if --quiet is specified.
20 // Appends a newline if not present.
21 S(msg string, args ...interface{})
22 // PT prints a message if verbosity >= 1 (neither --quiet nor --verbose is specified)
23 // and stdout points to a terminal.
24 // This is used for informational messages.
25 PT(msg string, args ...interface{})
26 // P prints a message if verbosity >= 1 (neither --quiet nor --verbose is specified),
27 // this is used for normal messages which are not errors. Appends a newline if not present.
28 P(msg string, args ...interface{})
29 // V prints a message if verbosity >= 2 (equivalent to --verbose), this is used for
30 // verbose messages. Appends a newline if not present.
31 V(msg string, args ...interface{})
32 // VV prints a message if verbosity >= 3 (equivalent to --verbose=2), this is used for
33 // debug messages. Appends a newline if not present.
34 VV(msg string, args ...interface{})
35}
36
37// NoopPrinter discards all messages
38type NoopPrinter struct{}

Callers 51

runCheckFunction · 0.95
RepairPacksFunction · 0.65
RepairIndexFunction · 0.65
rewriteIndexFilesFunction · 0.65
decidePackActionFunction · 0.65
ExecuteMethod · 0.65
deleteFilesFunction · 0.65
getUsedBlobsFunction · 0.65
runRestoreFunction · 0.65
runCheckFunction · 0.95
RepairPacksFunction · 0.65
reuploadBlobsFromPackFunction · 0.65

Implementers 3

NoopPrinterinternal/ui/progress/printer.go
TestPrinterinternal/ui/progress/printer.go
jsonErrorPrintercmd/restic/cmd_check.go

Calls

no outgoing calls

Tested by

no test coverage detected