output

package
v0.0.0-...-80f05ad Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	Name string `json:"name"`
	Type string `json:"type,omitempty"`
}

type Format

type Format string
const (
	FormatAuto  Format = "auto"
	FormatTable Format = "table"
	FormatPlain Format = "plain"
	FormatJSON  Format = "json"
	FormatCSV   Format = "csv"
)

func ParseFormat

func ParseFormat(s string) (Format, error)

type Option

type Option func(*Writer)

func WithErrorOutput

func WithErrorOutput(err io.Writer) Option

func WithFormat

func WithFormat(f Format) Option

func WithOutput

func WithOutput(out io.Writer) Option

func WithQuiet

func WithQuiet(quiet bool) Option

type QueryResult

type QueryResult struct {
	Columns []Column `json:"columns"`
	Rows    [][]any  `json:"rows"`
}

type Spinner

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

func NewSpinner

func NewSpinner(message string) *Spinner

func (*Spinner) Start

func (s *Spinner) Start()

func (*Spinner) Stop

func (s *Spinner) Stop()

func (*Spinner) StopWithError

func (s *Spinner) StopWithError(message string)

func (*Spinner) StopWithSuccess

func (s *Spinner) StopWithSuccess(message string)

type Writer

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

func New

func New(opts ...Option) *Writer

func (*Writer) ColorEnabled

func (w *Writer) ColorEnabled() bool

func (*Writer) Error

func (w *Writer) Error(format string, args ...any)

func (*Writer) Info

func (w *Writer) Info(format string, args ...any)

func (*Writer) IsTTY

func (w *Writer) IsTTY() bool

func (*Writer) Success

func (w *Writer) Success(format string, args ...any)

func (*Writer) WriteQueryResult

func (w *Writer) WriteQueryResult(result *QueryResult) error

Jump to

Keyboard shortcuts

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