consoleui

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsoleUi

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

ConsoleUi is a console-based implementation of UserInterface.

func New

func New(opts ...Option) *ConsoleUi

New creates a new ConsoleUi with the given options.

func (*ConsoleUi) Input

func (c *ConsoleUi) Input(prompt string) (string, error)

func (*ConsoleUi) NewProgressBar

func (c *ConsoleUi) NewProgressBar() uitypes.ProgressBar

func (*ConsoleUi) Output

func (c *ConsoleUi) Output(output string) error

func (*ConsoleUi) OutputError

func (c *ConsoleUi) OutputError(err error, opts ...uitypes.Opts) error

func (*ConsoleUi) SelectOptions

func (c *ConsoleUi) SelectOptions(prompt string, options []string) (int, string, error)

type Option

type Option func(*ConsoleUi)

Option is a functional option for configuring ConsoleUi.

func WithErrorOutput

func WithErrorOutput(errWriter io.Writer) Option

WithErrorOutput sets the error output writer.

func WithInput

func WithInput(in io.Reader) Option

WithInput sets the input reader.

func WithOutput

func WithOutput(out io.Writer) Option

WithOutput sets the output writer.

func WithProgressWriter

func WithProgressWriter(progressWriter io.Writer) Option

WithProgressWriter sets the progress bar writer.

type ProgressType

type ProgressType string

ProgressType defines the type of progress bar.

const (
	SpinnerType ProgressType = "spinner"
	BarType     ProgressType = "bar"
)

Jump to

Keyboard shortcuts

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