ui

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checkmark

type Checkmark struct {
	Checked   string
	Unchecked string
}

type Printer

type Printer interface {
	Printfln(format string, a ...interface{})
	Printf(format string, a ...interface{})
	Println(a ...interface{})
	Print(a ...interface{})
}

type Spinner

type Spinner interface {
	Success(message ...interface{})
	Warning(message ...interface{})
	Fail(message ...interface{})
}

type UI

type UI interface {
	AskForUsersInput(message string) string
	DisplayInteractiveMultiselect(msg string, options []string, checkMark Checkmark, optionsDefaultAll, filter bool, maxHeight int) []string
	DisplayInteractiveSelect(msg string, options []string, filter bool, maxHeight int) string
	DisplaySelectedItems(items []string)
	AskForUsersConfirmation(message string) bool
	StartSpinner(message string) Spinner

	// Printers
	Info() Printer
	Success() Printer
	Error() Printer
	Warning() Printer
	DefaultBox() Printer

	// Colors
	Green(...interface{}) string
	Red(...interface{}) string
	Yellow(...interface{}) string
	Blue(...interface{}) string

	//
	BasicCheckmark() Checkmark
}

func NewPTermUI

func NewPTermUI() UI

NewPTermUI creates a new ptermUI instance

Jump to

Keyboard shortcuts

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