console

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatCommandMessage

func FormatCommandMessage(command string) string

FormatCommandMessage formats a command execution message

func FormatCountMessage

func FormatCountMessage(message string) string

FormatCountMessage formats a count/numeric status message

func FormatError

func FormatError(err CompilerError) string

FormatError formats a CompilerError with Rust-like rendering

func FormatErrorMessage

func FormatErrorMessage(message string) string

FormatErrorMessage formats a simple error message (for stderr output)

func FormatInfoMessage

func FormatInfoMessage(message string) string

FormatInfoMessage formats an informational message

func FormatListHeader

func FormatListHeader(header string) string

FormatListHeader formats a section header for lists

func FormatListItem

func FormatListItem(item string) string

FormatListItem formats an item in a list

func FormatLocationMessage

func FormatLocationMessage(message string) string

FormatLocationMessage formats a file/directory location message

func FormatProgressMessage

func FormatProgressMessage(message string) string

FormatProgressMessage formats a progress/activity message

func FormatPromptMessage

func FormatPromptMessage(message string) string

FormatPromptMessage formats a user prompt message

func FormatSuccessMessage

func FormatSuccessMessage(message string) string

FormatSuccessMessage formats a success message with styling

func FormatVerboseMessage

func FormatVerboseMessage(message string) string

FormatVerboseMessage formats verbose debugging output

func FormatWarningMessage

func FormatWarningMessage(message string) string

FormatWarningMessage formats a warning message

func RenderTable

func RenderTable(config TableConfig) string

RenderTable renders a formatted table using lipgloss

func ToRelativePath

func ToRelativePath(path string) string

ToRelativePath converts an absolute path to a relative path from the current working directory

Types

type CompilerError

type CompilerError struct {
	Position ErrorPosition
	Type     string // "error", "warning", "info"
	Message  string
	Context  []string // Source code lines for context
	Hint     string   // Optional hint for fixing the error
}

CompilerError represents a structured compiler error with position information

type ErrorPosition

type ErrorPosition struct {
	File   string
	Line   int
	Column int
}

ErrorPosition represents a position in a source file

type SpinnerWrapper

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

SpinnerWrapper wraps the spinner functionality with TTY detection

func NewSpinner

func NewSpinner(message string) *SpinnerWrapper

NewSpinner creates a new spinner with the given message The spinner is automatically disabled when not running in a TTY

func (*SpinnerWrapper) IsEnabled

func (s *SpinnerWrapper) IsEnabled() bool

IsEnabled returns whether the spinner is enabled (i.e., running in a TTY)

func (*SpinnerWrapper) Start

func (s *SpinnerWrapper) Start()

Start begins the spinner animation

func (*SpinnerWrapper) Stop

func (s *SpinnerWrapper) Stop()

Stop stops the spinner animation

func (*SpinnerWrapper) UpdateMessage

func (s *SpinnerWrapper) UpdateMessage(message string)

UpdateMessage updates the spinner message

type TableConfig

type TableConfig struct {
	Headers   []string
	Rows      [][]string
	Title     string
	ShowTotal bool
	TotalRow  []string
}

TableConfig represents configuration for table rendering

Jump to

Keyboard shortcuts

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