output

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2026 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColorEnabled added in v0.2.0

func ColorEnabled(w io.Writer) bool

ColorEnabled reports whether ANSI color should be emitted to w. Honors the NO_COLOR convention (https://no-color.org): any non-empty value disables color.

func Colorize added in v0.2.0

func Colorize(w io.Writer, s string, codes ...Color) string

Colorize wraps s in ANSI escape sequences for the given colors when w is a terminal and NO_COLOR is unset; returns s unchanged otherwise.

func Errorf

func Errorf(format string, args ...any)

func Infof

func Infof(format string, args ...any)

func Printf

func Printf(format string, args ...any)

func SetQuiet

func SetQuiet(q bool)

func Warnf

func Warnf(format string, args ...any)

Types

type Color added in v0.2.0

type Color int
const (
	Red Color = iota
	Green
	Yellow
	Blue
	Magenta
	Cyan
	Dim
	Bold
)

type Table

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

func NewTable

func NewTable() *Table

func NewTableWriter

func NewTableWriter(out io.Writer) *Table

func (*Table) Flush

func (t *Table) Flush() error

func (*Table) Row

func (t *Table) Row(cols ...string)

type Tracker

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

func NewTracker

func NewTracker() *Tracker

func (*Tracker) Add

func (t *Tracker) Add(name string)

func (*Tracker) Done

func (t *Tracker) Done(name string)

func (*Tracker) Fail

func (t *Tracker) Fail(name string, err error)

func (*Tracker) Start

func (t *Tracker) Start()

func (*Tracker) Stop

func (t *Tracker) Stop()

Stop is safe to call more than once and is a no-op if Start was never called. The sync.Once protects the channel close; the atomic `started` flag protects against blocking forever on a `done` that no goroutine will ever close.

func (*Tracker) Update

func (t *Tracker) Update(name string, downloaded, total int64)

Jump to

Keyboard shortcuts

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