ui

package
v0.0.0-...-807c6dc Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fraction

func Fraction(n, d int) string

Fraction is a utility funcation that formats a fraction string, given a numerator and a denominator.

Types

type Spinner

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

Spinner coordinates the formatting of a log line with a spinner at the end.

func (*Spinner) Start

func (s *Spinner) Start(out io.Writer, prefix string)

Start begins the Spinner, which will write all output to the provided Writer. All log lines delivered to the Writer will be prefixed with the specified prefix.

func (*Spinner) Stop

func (s *Spinner) Stop()

Stop closes the Spinner.

func (*Spinner) Update

func (s *Spinner) Update(progress string)

Update passes an updated progress status to the spinner.

type Writer

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

Writer TODO(peter): document

func (*Writer) Flush

func (w *Writer) Flush(out io.Writer) error

Flush TODO(peter): document

func (*Writer) Write

func (w *Writer) Write(b []byte) (n int, err error)

Jump to

Keyboard shortcuts

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