Help us shape the future of Go! Take the 2026 Go Developer Survey

term

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PrimaryColor  = lipgloss.Color("#CE0000")
	SuccessColor  = lipgloss.Color("#10B981")
	WarningColor  = lipgloss.Color("#F59E0B")
	ErrorColor    = lipgloss.Color("#EF4444")
	MutedColor    = lipgloss.Color("#6B7280")
	HeaderBgColor = lipgloss.Color("#1A1A1A")

	TitleStyle = lipgloss.NewStyle().
				Bold(true).
				Foreground(lipgloss.Color("#FFFFFF")).
				Background(PrimaryColor).
				Padding(0, 1)

	SectionStyle = lipgloss.NewStyle().
					Bold(true).
					Foreground(PrimaryColor).
					MarginTop(1).
					MarginBottom(1)

	OkStyle = lipgloss.NewStyle().
			Foreground(SuccessColor)

	WarnStyle = lipgloss.NewStyle().
				Foreground(WarningColor)

	ErrStyle = lipgloss.NewStyle().
				Foreground(ErrorColor)

	MutedStyle = lipgloss.NewStyle().
				Foreground(MutedColor)

	TableHeaderStyle = lipgloss.NewStyle().
						Bold(true).
						Foreground(lipgloss.Color("#FFFFFF")).
						Background(HeaderBgColor).
						Padding(0, 1)

	TableCellStyle = lipgloss.NewStyle().
					Padding(0, 1)

	BoxStyle = lipgloss.NewStyle().
				Border(lipgloss.RoundedBorder()).
				BorderForeground(lipgloss.Color("#374151")).
				Padding(1, 2)
)

Functions

func DefaultPtermLogger added in v3.1.0

func DefaultPtermLogger(spinner *pterm.SpinnerPrinter) config.Logger

DefaultPtermLogger returns a Logger implementation that writes to the default pterm printers for each logging level.

If spinner is not nil, it is used to log status updates. The spinner must have been started already.

func DisableColor

func DisableColor()

func DisableDebug

func DisableDebug()

func DisableOutput

func DisableOutput()

func EnableDebug

func EnableDebug()

func EnableOutput

func EnableOutput()

func Error

func Error(input any)
func Header(header string)
func Hyperlink(url, text string) string

func Info

func Info(input any)

func Infof

func Infof(input any, args ...interface{})

func IsTerminal

func IsTerminal() bool

func Println

func Println(s string)

func RenderTable

func RenderTable(rows [][]string) string

func Section

func Section(s string)

func StatusIcon

func StatusIcon(ok bool) string

func StatusIconTri

func StatusIconTri(status string) string

func StopSpinner

func StopSpinner(s Spinner)

func Success

func Success(input any)

func Warning

func Warning(input any)

func Warningf

func Warningf(input any, args ...any)

Types

type PtermLogger added in v3.1.0

type PtermLogger struct {
	Error   pterm.TextPrinter
	Warning pterm.TextPrinter
	Info    pterm.TextPrinter
	Debug   pterm.TextPrinter
	Spinner *pterm.SpinnerPrinter
}

PtermLogger is a Logger implementation that writes to pterm printers. If any field is nil, PtermLogger discards all messages of that level.

func (*PtermLogger) Debugf added in v3.1.0

func (logger *PtermLogger) Debugf(format string, a ...any)

func (*PtermLogger) Errorf added in v3.1.0

func (logger *PtermLogger) Errorf(format string, a ...any)

func (*PtermLogger) Infof added in v3.1.0

func (logger *PtermLogger) Infof(format string, a ...any)

func (*PtermLogger) Statusf added in v3.1.0

func (logger *PtermLogger) Statusf(format string, a ...any)

func (*PtermLogger) Warningf added in v3.1.0

func (logger *PtermLogger) Warningf(format string, a ...any)

type Spinner

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

func StartSpinner

func StartSpinner(text string) Spinner

func (Spinner) Logger

func (s Spinner) Logger() config.Logger

Jump to

Keyboard shortcuts

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