Documentation
¶
Index ¶
- Constants
- Variables
- func Bold(text string) string
- func Code(text string) string
- func Dim(text string) string
- func EmptyLine()
- func Error(message string)
- func ErrorBox(message string)
- func FormatLogLine(line string, showTimestamps bool) string
- func FormatServiceHeader(serviceName, containerID string, isStreaming bool) string
- func FormatServiceStatus(status string) string
- func FormatStreamingFooter() string
- func Header(message string)
- func HealthCheckTable(category string, rows []HealthCheckRow) string
- func Highlight(text string) string
- func Hint(message string)
- func Info(message string)
- func InfoBox(message string)
- func KeyValueTable(title string, rows []KeyValueRow) string
- func List(item string)
- func ListItem(prefix, item string)
- func PortTable(rows []PortRow) string
- func RenderList(title string, items []string) string
- func RenderNumberedList(title string, items []string) string
- func Separator()
- func ServiceTable(projectName string, rows []ServiceRow) string
- func StatusFailed(text string) string
- func StatusRunning(text string) string
- func StatusStarting(text string) string
- func StatusStopped(text string) string
- func Subheader(message string)
- func Success(message string)
- func SuccessBox(message string)
- func Warning(message string)
- func WithProgress(message string, fn func() error) error
- type HealthCheckRow
- type KeyValueRow
- type LogLevel
- type PortRow
- type ProgressTracker
- type ServiceRow
- type Spinner
- func (s *Spinner) Error(message string)
- func (s *Spinner) Start()
- func (s *Spinner) Stop()
- func (s *Spinner) Success(message string)
- func (s *Spinner) UpdateMessage(message string)
- func (s *Spinner) Warning(message string)
- func (s *Spinner) WithArrow() *Spinner
- func (s *Spinner) WithCircle() *Spinner
- func (s *Spinner) WithColor(color lipgloss.Color) *Spinner
- func (s *Spinner) WithDots() *Spinner
- func (s *Spinner) WithLine() *Spinner
Constants ¶
const ( // Status symbols SymbolSuccess = "✓" // Checkmark SymbolError = "✗" // X mark SymbolWarning = "⚠" // Warning triangle SymbolInfo = "ℹ" // Info SymbolRunning = "●" // Filled circle SymbolStarting = "◐" // Half-filled circle SymbolStopped = "○" // Empty circle SymbolArrow = "→" // Right arrow SymbolBullet = "•" // Bullet point SymbolSparkle = "✨" // Sparkle (for special messages) SymbolRocket = "🚀" // Rocket (for deployments/starts) SymbolPackage = "📦" // Package (for containers) SymbolGear = "⚙" // Gear (for configuration) SymbolDoctor = "🩺" // Doctor (for health checks) SymbolLightbulb = "💡" // Lightbulb (for tips/hints) )
Variables ¶
var ( // ColorPrimary Primary colors ColorPrimary = lipgloss.Color("#7C3AED") // Purple - main brand ColorSecondary = lipgloss.Color("#06B6D4") // Cyan - accents // ColorSuccess Status colors ColorSuccess = lipgloss.Color("#10B981") // Green ColorWarning = lipgloss.Color("#F59E0B") // Amber ColorError = lipgloss.Color("#EF4444") // Red ColorInfo = lipgloss.Color("#3B82F6") // Blue // ColorRunning State colors ColorRunning = lipgloss.Color("#10B981") // Green ColorStarting = lipgloss.Color("#F59E0B") // Amber ColorStopped = lipgloss.Color("#6B7280") // Gray ColorFailed = lipgloss.Color("#EF4444") // Red // ColorText Text colors ColorText = lipgloss.Color("#E5E7EB") // Light gray ColorTextDim = lipgloss.Color("#9CA3AF") // Dim gray ColorTextBold = lipgloss.Color("#F9FAFB") // Almost white // ColorBgDark Background colors ColorBgDark = lipgloss.Color("#1F2937") // Dark gray ColorBgMedium = lipgloss.Color("#374151") // Medium gray ColorBgLight = lipgloss.Color("#4B5563") // Light gray ColorBgSuccess = lipgloss.Color("#064E3B") // Dark green ColorBgError = lipgloss.Color("#7F1D1D") // Dark red )
var ( // StyleBold Text styles StyleBold = lipgloss.NewStyle(). Bold(true). Foreground(ColorTextBold) StyleDim = lipgloss.NewStyle(). Foreground(ColorTextDim) StyleCode = lipgloss.NewStyle(). Foreground(ColorSecondary). Background(ColorBgDark). Padding(0, 1) // StyleSuccess Status styles StyleSuccess = lipgloss.NewStyle(). Foreground(ColorSuccess). Bold(true) StyleWarning = lipgloss.NewStyle(). Foreground(ColorWarning). Bold(true) StyleError = lipgloss.NewStyle(). Foreground(ColorError). Bold(true) StyleInfo = lipgloss.NewStyle(). Foreground(ColorInfo). Bold(true) // StyleSuccessBox Box styles for callouts StyleSuccessBox = lipgloss.NewStyle(). Foreground(ColorSuccess). Border(lipgloss.RoundedBorder()). BorderForeground(ColorSuccess). Padding(0, 1) StyleErrorBox = lipgloss.NewStyle(). Foreground(ColorError). Border(lipgloss.RoundedBorder()). BorderForeground(ColorError). Padding(0, 1) StyleInfoBox = lipgloss.NewStyle(). Foreground(ColorInfo). Border(lipgloss.RoundedBorder()). BorderForeground(ColorInfo). Padding(0, 1) // StyleHeader Header styles StyleHeader = lipgloss.NewStyle(). Foreground(ColorPrimary). Bold(true). Underline(true). MarginBottom(1) StyleSubheader = lipgloss.NewStyle(). Foreground(ColorSecondary). Bold(true) )
Functions ¶
func FormatLogLine ¶
FormatLogLine formats a single log line with appropriate color coding
func FormatServiceHeader ¶
FormatServiceHeader formats a header for log output showing service name and container ID
func FormatServiceStatus ¶
FormatServiceStatus formats a service status with an appropriate color and symbol
func FormatStreamingFooter ¶
func FormatStreamingFooter() string
FormatStreamingFooter shows a footer when streaming is active
func HealthCheckTable ¶
func HealthCheckTable(category string, rows []HealthCheckRow) string
HealthCheckTable creates a table for health check results
func KeyValueTable ¶
func KeyValueTable(title string, rows []KeyValueRow) string
KeyValueTable creates a simple two-column table for configuration display
func ListItem ¶
func ListItem(prefix, item string)
ListItem prints a bulleted list item with a custom prefix
func RenderList ¶
RenderList renders a simple styled list
func RenderNumberedList ¶
RenderNumberedList renders a numbered list
func ServiceTable ¶
func ServiceTable(projectName string, rows []ServiceRow) string
ServiceTable creates and renders a beautiful table for services
func StatusFailed ¶
StatusFailed returns a formatted "failed" status
func StatusRunning ¶
StatusRunning returns a formatted "running" status
func StatusStarting ¶
StatusStarting returns a formatted "starting" status
func StatusStopped ¶
StatusStopped returns a formatted "stopped" status
func WithProgress ¶
WithProgress wraps a long-running operation with a spinner
Types ¶
type HealthCheckRow ¶
HealthCheckRow represents a health check result
type KeyValueRow ¶
KeyValueRow represents a key-value pair
type ProgressTracker ¶
type ProgressTracker struct {
// contains filtered or unexported fields
}
ProgressTracker tracks progress through multiple steps
func NewProgressTracker ¶
func NewProgressTracker(steps []string) *ProgressTracker
NewProgressTracker creates a new progress tracker
func (*ProgressTracker) Complete ¶
func (p *ProgressTracker) Complete(message string)
Complete marks all steps as complete
func (*ProgressTracker) Fail ¶
func (p *ProgressTracker) Fail(message string)
Fail marks the progress as failed
func (*ProgressTracker) NextStep ¶
func (p *ProgressTracker) NextStep()
NextStep advances to the next step and prints progress
func (*ProgressTracker) Start ¶
func (p *ProgressTracker) Start()
Start prints the initial progress state
type ServiceRow ¶
type ServiceRow struct {
Service string
Status string
Ports []string
ContainerID string
Uptime string
}
ServiceRow represents a single row in the service table
type Spinner ¶
type Spinner struct {
// contains filtered or unexported fields
}
Spinner represents a simple terminal spinner for indicating progress
func NewSpinner ¶
NewSpinner creates a new spinner with a message
func ShowSpinner ¶
ShowSpinner creates, starts, and returns a spinner (convenience function)
func (*Spinner) UpdateMessage ¶
UpdateMessage changes the spinner message while it's running
func (*Spinner) WithCircle ¶
WithCircle creates a spinner with circle frames