progressui

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 23 Imported by: 138

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Display added in v0.13.0

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

func NewDisplay added in v0.13.0

func NewDisplay(out io.Writer, mode DisplayMode, opts ...DisplayOpt) (Display, error)

NewDisplay constructs a Display that outputs to the given io.Writer with the given DisplayMode.

This method will return an error when the DisplayMode is invalid or if TtyMode is used but the io.Writer does not refer to a tty. AutoMode will choose TtyMode or PlainMode depending on if the output is a tty or not.

For TtyMode to work, the io.Writer should also implement console.File.

func (Display) UpdateFrom added in v0.13.0

func (d Display) UpdateFrom(ctx context.Context, ch chan *client.SolveStatus) ([]client.VertexWarning, error)

type DisplayMode added in v0.13.0

type DisplayMode string
const (
	// DefaultMode is the default value for the DisplayMode.
	// This is effectively the same as AutoMode.
	DefaultMode DisplayMode = ""
	// AutoMode will choose TtyMode or PlainMode depending on if the output is
	// a tty.
	AutoMode DisplayMode = "auto"
	// QuietMode discards all output.
	QuietMode DisplayMode = "quiet"
	// TtyMode enforces the output is a tty and will otherwise cause an error if it isn't.
	TtyMode DisplayMode = "tty"
	// PlainMode is the human-readable plain text output. This mode is not meant to be read
	// by machines.
	PlainMode DisplayMode = "plain"
	// RawJSONMode is the raw JSON text output. It will marshal the various solve status events
	// to JSON to be read by an external program.
	RawJSONMode DisplayMode = "rawjson"
)

type DisplayOpt added in v0.13.0

type DisplayOpt func(b *displayOpts)

func WithDesc added in v0.12.0

func WithDesc(text string, console string) DisplayOpt

func WithPhase added in v0.12.0

func WithPhase(phase string) DisplayOpt

Jump to

Keyboard shortcuts

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