output

package
v0.0.0-...-8d28fdc Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OutputFormat

type OutputFormat string

OutputFormat represents the output format.

const (
	FormatAuto   OutputFormat = "auto"
	FormatJSON   OutputFormat = "json"
	FormatPlain  OutputFormat = "plain"
	FormatStyled OutputFormat = "styled"
)

type Spinner

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

Spinner provides a loading animation.

func NewSpinner

func NewSpinner(message string, writer io.Writer) *Spinner

NewSpinner creates a new spinner.

func (*Spinner) Error

func (s *Spinner) Error(message string)

Error stops the spinner and shows an error message.

func (*Spinner) Start

func (s *Spinner) Start()

Start begins the spinner animation.

func (*Spinner) Stop

func (s *Spinner) Stop()

Stop halts the spinner animation.

func (*Spinner) Success

func (s *Spinner) Success(message string)

Success stops the spinner and shows a success message.

type Writer

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

Writer handles output formatting and writing.

func New

func New(format OutputFormat, writer io.Writer) *Writer

New creates a new output writer.

func NewStderr

func NewStderr(format OutputFormat) *Writer

NewStderr creates a new output writer for stderr.

func NewStdout

func NewStdout(format OutputFormat) *Writer

NewStdout creates a new output writer for stdout.

func (*Writer) Print

func (w *Writer) Print(message string)

Print outputs a message based on the configured format.

func (*Writer) PrintBox

func (w *Writer) PrintBox(message string, boxStyle lipgloss.Style)

PrintBox outputs text in a styled box.

func (*Writer) PrintCommand

func (w *Writer) PrintCommand(command string)

PrintCommand outputs a command being executed.

func (*Writer) PrintData

func (w *Writer) PrintData(data interface{})

PrintData outputs structured data.

func (*Writer) PrintError

func (w *Writer) PrintError(message string)

PrintError outputs an error message.

func (*Writer) PrintHeading

func (w *Writer) PrintHeading(heading string)

PrintHeading outputs a heading.

func (*Writer) PrintInfo

func (w *Writer) PrintInfo(message string)

PrintInfo outputs an info message.

func (*Writer) PrintKeyValue

func (w *Writer) PrintKeyValue(key, value string)

PrintKeyValue outputs a key-value pair.

func (*Writer) PrintMonospace

func (w *Writer) PrintMonospace(text string)

PrintMonospace outputs text in monospace style.

func (*Writer) PrintSuccess

func (w *Writer) PrintSuccess(message string)

PrintSuccess outputs a success message.

func (*Writer) PrintWarning

func (w *Writer) PrintWarning(message string)

PrintWarning outputs a warning message.

Jump to

Keyboard shortcuts

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