ui

package
v0.15.4-rc.2 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 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 Option

type Option struct {
	Text string
	Fn   func(ui UI)
}

type UI

type UI interface {
	Banner(version string)

	Panic(error)
	Exit(string)

	Errorf(string, ...any)
	Warningf(string, ...any)
	Infof(string, ...any)
	Printlnf(string, ...any)

	Error(string)
	Warning(string)
	Info(string)
	Success(string)
	Finish()

	Println(string)
	Title(string)
	OpenBrowser(string) error

	Green(string) string
	Red(string) string

	Confirm(prompt string, defaultValue bool) bool
	Enter(msg string) bool
	Select(prompt string, options []Option, defaultIndex int) (selected Option)
	TextInput(msg, defaultValue string) string
}
var DefaultUI UI = &ptermUI{}

Jump to

Keyboard shortcuts

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