output

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: BSD-3-Clause Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bytes

func Bytes(value int64) string

func Configure

func Configure(stdout, stderr io.Writer, jsonMode, noColor bool, label string)

func Confirm

func Confirm(ctx context.Context, input io.Reader, out io.Writer, label string) (bool, error)

func CoordinatedWriter

func CoordinatedWriter(w io.Writer) io.Writer

func Copy

func Copy(ctx context.Context, dst io.Writer, src io.Reader, opts TransferOptions) (int64, error)
func Header(format string, a ...any)

func Info

func Info(format string, a ...any)

func IsTerminal

func IsTerminal(value any) bool

func KeyValue

func KeyValue(key string, value any)

func ReadWithContext

func ReadWithContext[T any](ctx context.Context, input io.Reader, read func(io.Reader) (T, error)) (T, error)

Pollable files cancel in place; other blocking readers use an asynchronous read.

func Secret

func Secret(ctx context.Context, input io.Reader, out io.Writer, label, flagName string) (string, error)

An empty value asks the caller to pass flagName instead.

func Showing

func Showing(shown int, total int64, label string)

func StartLoading

func StartLoading(ctx context.Context) *tracker

func StartTracker

func StartTracker(ctx context.Context, out io.Writer, enabled bool, labels ...string) *tracker

func Stderr

func Stderr() io.Writer

func Stdout

func Stdout() io.Writer

func Success

func Success(format string, a ...any)

func SuspendProgress

func SuspendProgress() func()

func Table

func Table(headers []string, rows [][]string) error

func TintEnabled

func TintEnabled(value string) string

func TintInsecure

func TintInsecure(value string) string

func TintStatus

func TintStatus(value string) string

func TintYesNo

func TintYesNo(value string) string

func UnsignedBytes

func UnsignedBytes(value uint64) string

func Warning

func Warning(format string, a ...any)

func WriteError

func WriteError(w io.Writer, err error)

Types

type TransferOptions

type TransferOptions struct {
	Label        string
	Total        int64
	ShowProgress bool
}

Jump to

Keyboard shortcuts

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