Documentation ¶
Index ¶
- func ApplyTheme(bar *progress.Bar, th *state.ProgressTheme)
- func Configure(noProgress, quiet, verbose, json, panic bool, assumeYes bool, ...)
- func Debug(msg string)
- func Debugf(format string, args ...interface{})
- func Die(msg string)
- func Dief(format string, args ...interface{})
- func EndProgress()
- func JsonEnabled() bool
- func Log(msg string)
- func Logf(format string, args ...interface{})
- func Login(uri string)
- func Logl(level string, msg string)
- func Loglf(level string, format string, args ...interface{})
- func NewStateConsumer() *state.Consumer
- func Notice(header string, lines []string)
- func Object(typ string, msg JsonMessage)
- func Opf(format string, args ...interface{})
- func PauseProgress()
- func Progress(alpha float64)
- func ProgressLabel(label string)
- func ProgressScale(scale float64)
- func Request(operation string, request string, params interface{})
- func Result(value interface{})
- func ResultOrPrint(value interface{}, p printerFunc)
- func ResumeProgress()
- func StartProgress()
- func StartProgressWithTotalBytes(totalBytes int64)
- func Statf(format string, args ...interface{})
- func Warn(msg string)
- func Warnf(format string, args ...interface{})
- func YesNo(question string) bool
- type JsonMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyTheme ¶
func ApplyTheme(bar *progress.Bar, th *state.ProgressTheme)
func Debug ¶
func Debug(msg string)
Debug messages are like Info messages, but printed only when verbose
func Debugf ¶
func Debugf(format string, args ...interface{})
Debugf is a formatted variant of Debug
func Die ¶
func Die(msg string)
Die exits with a non-zero exit code after giving a reson to the client
func JsonEnabled ¶
func JsonEnabled() bool
func Logf ¶
func Logf(format string, args ...interface{})
Logf sends a formatted informational message to the client
func NewStateConsumer ¶
NewStateConsumer returns an implementor of `pwr.StateConsumer` that prints directly to the console via butler's logging functions.
func Notice ¶
Notice prints a box with important info in it. UX style guide: don't abuse it or people will stop reading it.
func Object ¶
func Object(typ string, msg JsonMessage)
func Opf ¶
func Opf(format string, args ...interface{})
Opf prints a formatted string informing the user on what operation we're doing
func Progress ¶
func Progress(alpha float64)
Progress sets the completion of a task whose progress is being printed It only has an effect if StartProgress was already called.
func ProgressLabel ¶
func ProgressLabel(label string)
ProgressLabel sets the string printed next to the progress indicator
func ProgressScale ¶
func ProgressScale(scale float64)
ProgressScale sets the scale on which the progress bar is displayed. This can be useful when the progress value evolves in another interval than [0, 1]
func ResultOrPrint ¶
func ResultOrPrint(value interface{}, p printerFunc)
func ResumeProgress ¶
func ResumeProgress()
ResumeProgress resumes printing the progress bar after PauseProgress was called
func StartProgress ¶
func StartProgress()
StartProgress begins a period in which progress is regularly printed
func StartProgressWithTotalBytes ¶
func StartProgressWithTotalBytes(totalBytes int64)
StartProgressWithTotalBytes begins a period in which progress is regularly printed, and bps (bytes per second) is estimated from the total size given
Types ¶
type JsonMessage ¶
type JsonMessage map[string]interface{}