Documentation
¶
Index ¶
Constants ¶
View Source
const ( StatusOK = "ok" StatusError = "error" StatusWarn = "warn" StatusInProgress = "in_progress" )
Variables ¶
View Source
var ( ColorDebug = color.New(color.FgWhite, color.Faint) ColorHeader = color.New(color.Bold) ColorInfo = color.New() ColorProgress = color.New(color.FgCyan) ColorProgressBold = color.New(color.FgCyan, color.Bold) ColorError = color.New(color.FgRed) ColorErrorBold = color.New(color.FgRed, color.Bold) ColorSuccess = color.New(color.FgGreen) ColorSuccessBold = color.New(color.FgGreen, color.Bold) ColorWarning = color.New(color.FgYellow) ColorWarningBold = color.New(color.FgYellow, color.Bold) )
Functions ¶
func ColorizedOutput ¶
ColorizedOutput outputs a colored message directly to the terminal. The remaining arguments should be interpolations for the format string.
func IsTerminal ¶
func IsTerminal() bool
Types ¶
type Progress ¶
type Progress interface {
// Add adds an additional bar to the progress
Add(id, displayName, message string, total int64)
// Update bars status, message and amount
Update(id, status, msg string, amount int)
// Increment the progress by given amount
Increment(id string, amount int)
// AttachReader to a progress so when an io is read the bar will update as well
AttachReader(id string, data io.Reader) io.Reader
// Wait for all progress bars to finish
Wait()
// MarkAllDone marks all progress bars as done
MarkAllDone()
}
Progress is used to provide an updating progress to the user. The progress usually has one or more bars
type ProgressUpdateFunc ¶ added in v0.13.8
func CreateProgressUpdater ¶ added in v0.13.8
func CreateProgressUpdater(progress Progress, displayName string) ProgressUpdateFunc
CreateProgressUpdater creates a progress update callback method for periodic updates.
Click to show internal directories.
Click to hide internal directories.