Documentation ¶
Index ¶
- func FormatBytes(c uint64) string
- func FormatDuration(d time.Duration) string
- func FormatPercent(numerator uint64, denominator uint64) string
- func FormatSeconds(sec uint64) string
- func ParseBytes(s string) (int64, error)
- func TerminalDisplayWidth(s string) int
- func ToJSONString(status interface{}) string
- type Message
- type MockTerminal
- type Terminal
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.
func ParseBytes ¶ added in v0.16.0
ParseBytes parses a size in bytes from s. It understands the suffixes B, K, M, G and T for powers of 1024.
func TerminalDisplayWidth ¶ added in v0.17.0
TerminalDisplayWidth returns the number of terminal cells needed to display s
func ToJSONString ¶ added in v0.16.0
func ToJSONString(status interface{}) string
Types ¶
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
Message reports progress with messages of different verbosity.
func NewMessage ¶
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 MockTerminal ¶ added in v0.17.1
func (*MockTerminal) CanUpdateStatus ¶ added in v0.17.1
func (m *MockTerminal) CanUpdateStatus() bool
func (*MockTerminal) Error ¶ added in v0.17.1
func (m *MockTerminal) Error(line string)
func (*MockTerminal) Print ¶ added in v0.17.1
func (m *MockTerminal) Print(line string)
func (*MockTerminal) SetStatus ¶ added in v0.17.1
func (m *MockTerminal) SetStatus(lines []string)
Click to show internal directories.
Click to hide internal directories.