Documentation
¶
Overview ¶
Package ui provides shared CLI reporting primitives for rich and plain-text terminal output.
Index ¶
- func ColorEnabled(w io.Writer, mode ColorMode) bool
- type ColorMode
- type Console
- func (c *Console) Accent(text string) string
- func (c *Console) Brand(text string) string
- func (c *Console) Code(text string) string
- func (c *Console) Error(label string, details string) error
- func (c *Console) Header(title string, details ...string) string
- func (c *Console) Info(label string, details string) error
- func (c *Console) Join(parts ...string) string
- func (c *Console) Muted(text string) string
- func (c *Console) Path(text string) string
- func (c *Console) Printf(format string, args ...any) error
- func (c *Console) Println(text string) error
- func (c *Console) Stage(label string, details string) error
- func (c *Console) Strong(text string) string
- func (c *Console) Success(label string, details string) error
- func (c *Console) Warning(label string, details string) error
- type Reporter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ColorMode ¶
type ColorMode string
ColorMode controls whether terminal styling should be emitted.
func ParseColorMode ¶
ParseColorMode validates a user-supplied color mode.
type Console ¶
type Console struct {
// contains filtered or unexported fields
}
Console renders consistent human-facing CLI output.
func NewConsole ¶
NewConsole creates a console that respects the requested color mode.
type Reporter ¶
type Reporter struct {
// contains filtered or unexported fields
}
Reporter renders consistent CLI output for commands.
func NewReporter ¶
NewReporter creates a reporter that auto-detects whether rich styling should be enabled.
func (*Reporter) Diagnostics ¶
func (r *Reporter) Diagnostics(diagnostics []validator.Diagnostic) error
Diagnostics prints grouped warnings and errors.
Click to show internal directories.
Click to hide internal directories.