Documentation ¶
Index ¶
- func PrintBlue(format string, a ...interface{})
- func PrintError(msg string, a ...interface{})
- func PrintGreen(format string, a ...interface{})
- func PrintRed(format string, a ...interface{})
- func PrintWhite(format string, a ...interface{})
- func RunToggleCLI(exec ToggleExecutor)
- func SimplePrompt(promptText string) string
- type CLI
- type ToggleExecutor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintBlue ¶
func PrintBlue(format string, a ...interface{})
PrintBlue wraps the fmt.Printf function with ANSI escape codes to color the given text blue.
func PrintError ¶
func PrintError(msg string, a ...interface{})
PrintError writes the given message to stderr
func PrintGreen ¶
func PrintGreen(format string, a ...interface{})
PrintGreen wraps the fmt.Printf function with ANSI escape codes to color the given text green.
func PrintRed ¶
func PrintRed(format string, a ...interface{})
PrintRed wraps the fmt.Printf function with ANSI escape codes to color the given text red.
func PrintWhite ¶
func PrintWhite(format string, a ...interface{})
PrintWhite wraps the fmt.Printf function with ANSI escape codes to color the given text white.
func RunToggleCLI ¶
func RunToggleCLI(exec ToggleExecutor)
RunToggleCLI runs a basic on/off state user interface. The user presses Enter to toggle between states, which will cause the given ToggleExecutor to run.
func SimplePrompt ¶
SimplePrompt returns the user input for a single prompt
Types ¶
type ToggleExecutor ¶
type ToggleExecutor interface { // GetPrompt returns a string for the given toggle state. GetPrompt(toggleState bool) string // ToggleOn runs code for the on state. ToggleOn() // ToggleOff runs code for the off state. ToggleOff() }
ToggleExecutor defines methods to get prompt text and execute functions as the user toggles between on/off states.