Skip to content

Commit

Permalink
add doc for printer
Browse files Browse the repository at this point in the history
  • Loading branch information
St3ffn committed May 30, 2021
1 parent 31617c5 commit 6e5ac9f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/printer/printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type Printer interface {

type DefaultPrinter struct{}

// Print prints the amount of plots left
func (d DefaultPrinter) Print(info *disk.PlotInfo) {
_, _ = fmt.Fprintln(Output, info.PlotsLeft())
}
Expand All @@ -25,6 +26,8 @@ type VerbosePrinter struct {}

const verboseHeader string = "Path\tTotal\tStored\tReserved\tLeft\n"

// Print prints two lines with the following columns:
// Path, Total Amount of Plots, Amount of Plots Stored, Plots Left
func (v VerbosePrinter) Print(info *disk.PlotInfo) {
w := tabwriter.NewWriter(Output, 0, 0, 1, ' ', tabwriter.TabIndent)
_, _ = fmt.Fprint(w, verboseHeader)
Expand Down

0 comments on commit 6e5ac9f

Please sign in to comment.