Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatBytes ¶ added in v0.15.0
func FormatDuration ¶ added in v0.15.0
FormatDuration formats d as FormatSeconds would.
func FormatPercent ¶ added in v0.15.0
FormatPercent formats numerator/denominator as a percentage.
func FormatSeconds ¶ added in v0.15.0
FormatSeconds formats sec as MM:SS, or HH:MM:SS if sec seconds is at least an hour.
Types ¶
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
Message reports progress with messages of different verbosity.
func NewMessage ¶
func NewMessage(term *termstatus.Terminal, verbosity uint) *Message
NewMessage returns a message progress reporter with underlying terminal term.
func (*Message) P ¶
P prints a message if verbosity >= 1, this is used for normal messages which are not errors.
type StdioWrapper ¶
type StdioWrapper struct {
// contains filtered or unexported fields
}
StdioWrapper provides stdout and stderr integration with termstatus.
func NewStdioWrapper ¶
func NewStdioWrapper(term *termstatus.Terminal) *StdioWrapper
NewStdioWrapper initializes a new stdio wrapper that can be used in place of os.Stdout or os.Stderr.
func (*StdioWrapper) Stderr ¶
func (w *StdioWrapper) Stderr() io.WriteCloser
Stderr returns a writer that is line buffered and can be used in place of os.Stderr. On Close(), the remaining bytes are written, followed by a line break.
func (*StdioWrapper) Stdout ¶
func (w *StdioWrapper) Stdout() io.WriteCloser
Stdout returns a writer that is line buffered and can be used in place of os.Stdout. On Close(), the remaining bytes are written, followed by a line break.