ui

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package ui provides the presentation layer for the CLI, handling output formatting and user interaction.

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) *Presenter

NewPresenter creates a new Console instance with Pulumi-like color support.

func (*Presenter) Advice

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

Advice prints advice.

func (*Presenter) Detail

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

Detail prints detail.

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)

Error prints an error.

func (*Presenter) Header

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

Header prints a header.

func (*Presenter) Highlight

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

Highlight highlights text.

func (*Presenter) Info

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

Info prints info.

func (*Presenter) InfoPrefixOnly

func (p *Presenter) InfoPrefixOnly()

InfoPrefixOnly prints the info prefix.

func (*Presenter) Newline

func (p *Presenter) Newline()

Newline prints a 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)

PromptForConfirmation prompts the user for confirmation.

func (*Presenter) PromptForInput

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

PromptForInput prompts the user for input.

func (*Presenter) PromptForMultiSelect added in v0.2.1

func (p *Presenter) PromptForMultiSelect(title string, options []string) ([]string, error)

PromptForMultiSelect displays a multi-choice list to the user and returns the selected options.

func (*Presenter) PromptForSelect added in v0.2.1

func (p *Presenter) PromptForSelect(title string, options []string) (string, error)

PromptForSelect displays a single-choice list to the user and returns the selected option.

func (*Presenter) Separator

func (p *Presenter) Separator()

Separator prints a separator.

func (*Presenter) Step

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

Step prints a step.

func (*Presenter) Success

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

Success prints success.

func (*Presenter) Summary

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

Summary prints a summary.

func (*Presenter) Warning

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

Warning prints a warning.

Jump to

Keyboard shortcuts

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