ui

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 6, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Presenter

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

Presenter handles structured writing to standard output and standard error, and reading standardized user input, mimicking the Pulumi CLI style.

func NewPresenter

func NewPresenter(outW, errW io.Writer, inR io.Reader) *Presenter

NewPresenter creates a new Console instance with Pulumi-like color support. Color support is automatically detected and disabled if the terminal doesn't support it or if the NO_COLOR environment variable is set. If outW, errW, or inR are nil, they default to os.Stdout, os.Stderr, and os.Stdin respectively.

func (*Presenter) Advice

func (p *Presenter) Advice(format string, a ...any)

func (*Presenter) Detail

func (p *Presenter) Detail(format string, a ...any)

func (*Presenter) Err

func (p *Presenter) Err() io.Writer

Err returns the configured error writer (typically os.Stderr).

func (*Presenter) Error

func (p *Presenter) Error(format string, a ...any)

func (*Presenter) Header

func (p *Presenter) Header(format string, a ...any)

func (*Presenter) Highlight

func (p *Presenter) Highlight(text string) string

func (*Presenter) Info

func (p *Presenter) Info(format string, a ...any)

func (*Presenter) InfoPrefixOnly

func (p *Presenter) InfoPrefixOnly()

func (*Presenter) Newline

func (p *Presenter) Newline()

func (*Presenter) Out

func (p *Presenter) Out() io.Writer

Out returns the configured output writer (typically os.Stdout).

func (*Presenter) PromptForConfirmation

func (p *Presenter) PromptForConfirmation(prompt string) (bool, error)

func (*Presenter) PromptForInput

func (p *Presenter) PromptForInput(prompt string) (string, error)

func (*Presenter) Separator

func (p *Presenter) Separator()

func (*Presenter) Step

func (p *Presenter) Step(format string, a ...any)

func (*Presenter) Success

func (p *Presenter) Success(format string, a ...any)

func (*Presenter) Summary

func (p *Presenter) Summary(format string, a ...any)

func (*Presenter) Warning

func (p *Presenter) Warning(format string, a ...any)

Jump to

Keyboard shortcuts

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