func Bold(s string)
Bold will print out a bolded string
func ColorPicker() color.Attribute
ColorPicker picks a color from colors slice defined at the starting of this file It increments the colorCounter variable so that next iteration returns a different color
func Deprecate(what, nextAction string)
Deprecate will output a warning symbol and then "Deprecated" at the end of the output in YELLOW
⚠ <message all yellow>
func Describef(title string, format string, a ...interface{})
Describef will print out the first variable as BOLD and then the second not.. this is intended to be used with `odo describe` and other outputs that list a lot of information
func DisplayExperimentalWarning()
DisplayExperimentalWarning displays the experimental mode warning message.
func Error(a ...interface{})
Error will output in an appropriate "progress" manner ✗ <message>
func Errorf(format string, a ...interface{})
Errorf will output in an appropriate "progress" manner ✗ <message>
func Ferror(w io.Writer, a ...interface{})
Frror will output in an appropriate "progress" manner ✗ <message>
func Ferrorf(w io.Writer, format string, a ...interface{})
Ferrorf will output in an appropriate "progress" manner ✗ <message>
func Finfof(w io.Writer, format string, a ...interface{})
Finfof will simply print out information on a new (bolded) line this is intended as information *after* something has been deployed This will also use a WRITER input We will have to manually check to see if it's Windows platform or not to determine if we are allowed to bold the output or not. **Line in bold**
func Fprintf(w io.Writer, format string, a ...interface{})
Fprintf will output in an appropriate "information" manner; for e.g. • <message>
func Fprintln(w io.Writer)
Fprintln will output a new line when applicable
func Fsuccess(out io.Writer, a ...interface{})
Fsuccess will output in an appropriate "progress" manner in out writer
✓ <message>
func Fwarning(out io.Writer, a ...interface{})
Fwarning will output in an appropriate "progress" manner in out writer
⚠ <message>
func Fwarningf(w io.Writer, format string, a ...interface{})
Fwarningf will output in an appropriate "warning" manner
⚠ <message>
func GetStderr() io.Writer
GetStderr gets the appropriate stderrfrom the OS. If it's Linux, it will use the go-colorable library in order to fix any and all color ASCII issues. TODO: Test needs to be added once we get Windows testing available on TravisCI / CI platform.
func GetStdout() io.Writer
GetStdout gets the appropriate stdout from the OS. If it's Linux, it will use the go-colorable library in order to fix any and all color ASCII issues. TODO: Test needs to be added once we get Windows testing available on TravisCI / CI platform.
func Info(a ...interface{})
Info will simply print out information on a new (bolded) line this is intended as information *after* something has been deployed **Line in bold**
func Infof(format string, a ...interface{})
Infof will simply print out information on a new (bolded) line this is intended as information *after* something has been deployed **Line in bold**
func IsAppleSilicon() bool
IsAppleSilicon returns true if we are on a Mac M1 / Apple Silicon natively
func IsDebug() bool
IsDebug returns true if we are debugging (-v is set to anything but 0)
func IsJSON() bool
IsJSON returns true if we are in machine output mode.. under NO circumstances should we output any logging.. as we are only outputting json
func IsTerminal(w io.Writer) bool
IsTerminal returns true if the writer w is a terminal This function is modified if we are running within Windows.. as Golang's built-in "IsTerminal" command only works on UNIX-based systems: https://github.com/golang/crypto/blob/master/ssh/terminal/util.go#L5
func Printf(format string, a ...interface{})
Printf will output in an appropriate "information" manner; for e.g. • <message>
func Println()
Println will output a new line when applicable
func Sbold(s string) string
Sbold will return a bold string
func SboldColor(c color.Attribute, s string) string
BoldColor will print out a bolded string with a color (that's passed in)
func Section(a ...interface{})
Section outputs a title in BLUE and underlined for separating a section (such as building a container, deploying files, etc.) T͟h͟i͟s͟ ͟i͟s͟ ͟u͟n͟d͟e͟r͟l͟i͟n͟e͟d͟ ͟b͟l͟u͟e͟ ͟t͟e͟x͟t͟
func Sectionf(format string, a ...interface{})
Sectionf outputs a title in BLUE and underlined for separating a section (such as building a container, deploying files, etc.) T͟h͟i͟s͟ ͟i͟s͟ ͟u͟n͟d͟e͟r͟l͟i͟n͟e͟d͟ ͟b͟l͟u͟e͟ ͟t͟e͟x͟t͟
func Stitle(firstLine, secondLine string) string
Stitle is the same as Title but returns the string instead
func StitleWithVersion(firstLine, secondLine, versionLine string) string
StitleWithVersion is the same as Stitle, but it allows to customize the version message line
func Success(a ...interface{})
Success will output in an appropriate "success" manner ✓ <message>
func Successf(format string, a ...interface{})
Successf will output in an appropriate "progress" manner
✓ <message>
func Title(firstLine, secondLine string)
Title Prints the logo as well as the first line being BLUE (indicator of the command information); the second line is optional and provides information in regard to what is being run. The last line displays information about the current odo version.
__ / \__ **First line** \__/ \ Second line / \__/ odo version: <VERSION> \__/
func Warning(a ...interface{})
Warning will output in an appropriate "progress" manner
⚠ <message>
func Warningf(format string, a ...interface{})
Warningf will output in an appropriate "warning" manner
⚠ <message>
Status is used to track ongoing status in a CLI, with a nice loading spinner when attached to a terminal
type Status struct {
// contains filtered or unexported fields
}
func ExplicitSpinner(status string, preventSpinning bool) *Status
ExplicitSpinner creates a spinner that can or not spin based on the value of the preventSpinning parameter
func Fspinnerf(w io.Writer, format string, a ...interface{}) *Status
Fspinnerf creates a spinner, sets the prefix then returns it. Remember to use .End(bool) to stop the spin / when you're done. For example: defer s.End(false) for situations where spinning isn't viable (debug)
func NewStatus(w io.Writer) *Status
NewStatus creates a new default Status
func Spinner(status string) *Status
Spinner creates a spinner, sets the prefix then returns it. Remember to use .End(bool) to stop the spin / when you're done. For example: defer s.End(false)
func SpinnerNoSpin(status string) *Status
SpinnerNoSpin is the same as the "Spinner" function but forces no spinning
func Spinnerf(format string, a ...interface{}) *Status
Spinnerf creates a spinner, sets the prefix then returns it. Remember to use .End(bool) to stop the spin / when you're done. For example: defer s.End(false) for situations where spinning isn't viable (debug)
func (s *Status) End(success bool)
End completes the current status, ending any previous spinning and marking the status as success or failure
func (s *Status) EndWithStatus(status string, success bool)
EndWithStatus is similar to End, but lets the user specify a custom message/status while ending
func (s *Status) Start(status string, debug bool)
Start starts a new phase of the status, if attached to a terminal there will be a loading spinner with this status
func (s *Status) WarningStatus(status string)
WarningStatus puts a warning status within the spinner and then updates the current status