Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Display ¶
type Display struct {
// contains filtered or unexported fields
}
func NewDisplay ¶
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 ¶
func (d Display) UpdateFrom(ctx context.Context, ch chan *client.SolveStatus) ([]client.VertexWarning, error)
type DisplayMode ¶
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 ¶
type DisplayOpt func(b *displayOpts)
func WithDesc ¶
func WithDesc(text string, console string) DisplayOpt
func WithPhase ¶
func WithPhase(phase string) DisplayOpt
Click to show internal directories.
Click to hide internal directories.