Documentation ¶
Index ¶
- Variables
- func ColoredTaskStatus(status baur.TaskStatus) string
- func FormatDuration(d time.Duration, opts ...FormatOption) string
- func FormatSize(bytes uint64, opts ...FormatOption) string
- type FormatOption
- type Stream
- func (s *Stream) ErrPrintf(err error, format string, a ...interface{})
- func (s *Stream) ErrPrintln(err error, msg ...interface{})
- func (s *Stream) PrintSep()
- func (s *Stream) Printf(format string, a ...interface{})
- func (s *Stream) Println(a ...interface{})
- func (s *Stream) TaskPrintf(task *baur.Task, format string, a ...interface{})
- func (s *Stream) Write(p []byte) (n int, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( GreenHighlight = color.New(color.FgGreen).SprintFunc() RedHighlight = color.New(color.FgRed).SprintFunc() YellowHighlight = color.New(color.FgYellow).SprintFunc() MagentaHighlight = color.New(color.FgMagenta).SprintFunc() Underline = color.New(color.Underline).SprintFunc() Highlight = MagentaHighlight )
Functions ¶
func ColoredTaskStatus ¶
func ColoredTaskStatus(status baur.TaskStatus) string
func FormatDuration ¶
func FormatDuration(d time.Duration, opts ...FormatOption) string
func FormatSize ¶
func FormatSize(bytes uint64, opts ...FormatOption) string
Types ¶
type FormatOption ¶
type FormatOption func(*fmtSettings)
func FormatBaseWithoutUnitName ¶
func FormatBaseWithoutUnitName(enable bool) FormatOption
FormatBaseWithoutUnitName when enabled the Format functions return the value in its base unit without unit-name suffix
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
Stream is a concurrency-safe output for term.messages.
func (*Stream) ErrPrintf ¶ added in v2.1.0
ErrPrintf prints an error with an optional printf-style message. The method prints the error in the format: errorPrefix msg: err
func (*Stream) ErrPrintln ¶ added in v2.1.0
ErrPrintln prints an error with an optional message. The method prints the error in the format: errorPrefix msg: err
func (*Stream) TaskPrintf ¶
TaskPrintf prints a message that is prefixed with '<TASK-NAME>: '
Click to show internal directories.
Click to hide internal directories.