Documentation ¶
Index ¶
- Variables
- type Color
- type Logger
- func (l *Logger) Errf(color Color, s string, args ...any)
- func (l *Logger) FOutf(w io.Writer, color Color, s string, args ...any)
- func (l *Logger) Outf(color Color, s string, args ...any)
- func (l *Logger) Prompt(color Color, prompt string, defaultValue string, continueValues ...string) error
- func (l *Logger) VerboseErrf(color Color, s string, args ...any)
- func (l *Logger) VerboseOutf(color Color, s string, args ...any)
- func (l *Logger) Warnf(message string, args ...any)
- type PrintFunc
- func Blue() PrintFunc
- func BrightBlue() PrintFunc
- func BrightCyan() PrintFunc
- func BrightGreen() PrintFunc
- func BrightMagenta() PrintFunc
- func BrightRed() PrintFunc
- func BrightYellow() PrintFunc
- func Cyan() PrintFunc
- func Default() PrintFunc
- func Green() PrintFunc
- func Magenta() PrintFunc
- func Red() PrintFunc
- func Yellow() PrintFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrPromptCancelled = errors.New("prompt cancelled") ErrNoTerminal = errors.New("no terminal") )
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct { Stdin io.Reader Stdout io.Writer Stderr io.Writer Verbose bool Color bool AssumeYes bool AssumeTerm bool // Used for testing }
Logger is just a wrapper that prints stuff to STDOUT or STDERR, with optional color.
func (*Logger) VerboseErrf ¶
VerboseErrf prints stuff to STDERR if verbose mode is enabled.
func (*Logger) VerboseOutf ¶
VerboseOutf prints stuff to STDOUT if verbose mode is enabled.
type PrintFunc ¶
func BrightBlue ¶ added in v3.38.0
func BrightBlue() PrintFunc
func BrightCyan ¶ added in v3.38.0
func BrightCyan() PrintFunc
func BrightGreen ¶ added in v3.38.0
func BrightGreen() PrintFunc
func BrightMagenta ¶ added in v3.38.0
func BrightMagenta() PrintFunc
func BrightYellow ¶ added in v3.38.0
func BrightYellow() PrintFunc
Click to show internal directories.
Click to hide internal directories.