ui

package
v0.10.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoldString

func BoldString(msg string) string

func BoldStringf

func BoldStringf(msg string, a ...interface{}) string

func DisplayPath

func DisplayPath(path string) string

func ErrorString

func ErrorString(msg string) string

func ErrorStringf

func ErrorStringf(msg string, a ...interface{}) string

func FaintString

func FaintString(msg string) string

func FaintStringf

func FaintStringf(msg string, a ...interface{}) string

func Indent

func Indent(s, indent string) string

func LinkString

func LinkString(msg string) string

func LinkStringf

func LinkStringf(msg string, a ...interface{}) string

func PrimaryString

func PrimaryString(msg string) string

func PrimaryStringf

func PrimaryStringf(msg string, a ...interface{}) string

func PrintError

func PrintError(w io.Writer, msg string)

func PrintErrorf

func PrintErrorf(w io.Writer, msg string, a ...interface{})

func PrintSuccess

func PrintSuccess(w io.Writer, msg string)

func PrintSuccessf

func PrintSuccessf(w io.Writer, msg string, a ...interface{})

func PrintUnexpectedErrorStack added in v0.9.17

func PrintUnexpectedErrorStack(out io.Writer, err error)

PrintUnexpectedErrorStack prints a full stack trace of a fatal error.

func PrintUsage added in v0.9.9

func PrintUsage(cmd *cobra.Command)

func PrintWarning

func PrintWarning(w io.Writer, msg string)

func PrintWarningf

func PrintWarningf(w io.Writer, msg string, a ...interface{})

func SecondaryLinkString added in v0.9.19

func SecondaryLinkString(msg string) string

func SecondaryLinkStringf added in v0.9.19

func SecondaryLinkStringf(msg string, a ...interface{}) string

func StringPrompt added in v0.9.19

func StringPrompt(label string, validate ValidateFn) string

StringPrompt provides a single line for user input. It accepts an optional validation function.

func StripColor

func StripColor(str string) string

func SuccessString

func SuccessString(msg string) string

func SuccessStringf

func SuccessStringf(msg string, a ...interface{}) string

func UnderlineString

func UnderlineString(msg string) string

func UnderlineStringf

func UnderlineStringf(msg string, a ...interface{}) string

func WarningString

func WarningString(msg string) string

func WarningStringf

func WarningStringf(msg string, a ...interface{}) string

func YesNoPrompt added in v0.9.19

func YesNoPrompt(label string) bool

YesNoPrompt provides a yes/no user input. "No" is a default answer if left empty.

Types

type Spinner

type Spinner struct {
	// contains filtered or unexported fields
}

func NewSpinner

func NewSpinner(msg string, opts SpinnerOptions) *Spinner

func (*Spinner) Fail

func (s *Spinner) Fail()

func (*Spinner) Stop

func (s *Spinner) Stop()

func (*Spinner) Success

func (s *Spinner) Success()

func (*Spinner) SuccessWithMessage added in v0.9.12

func (s *Spinner) SuccessWithMessage(newMsg string)

type SpinnerFunc added in v0.9.22

type SpinnerFunc func(msg string) *Spinner

SpinnerFunc defines a function that returns a Spinner which can be used to report the progress of a certain action.

type SpinnerOptions

type SpinnerOptions struct {
	EnableLogging bool
	NoColor       bool
	Indent        string
}

type ValidateFn added in v0.9.19

type ValidateFn func(input string) error

ValidateFn represents a validation function type for prompts. Function of this type should accept a string input and return an error if validation fails; otherwise return nil.

type WriteWarningFunc added in v0.9.22

type WriteWarningFunc func(msg string)

WriteWarningFunc defines an interface that writes the provided msg as a warning to an underlying writer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL