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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatBytes ¶
func FormatDuration ¶
FormatDuration formats d as FormatSeconds would.
func FormatPercent ¶
FormatPercent formats numerator/denominator as a percentage.
func FormatSeconds ¶
FormatSeconds formats sec as MM:SS, or HH:MM:SS if sec seconds is at least an hour.
func ParseBytes ¶
ParseBytes parses a size in bytes from s. It understands the suffixes B, K, M, G and T for powers of 1024.
func TerminalDisplayWidth ¶
TerminalDisplayWidth returns the number of terminal cells needed to display s
func ToJSONString ¶
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 ¶
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.
Click to show internal directories.
Click to hide internal directories.