menu

package
v0.0.0-...-6467897 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2021 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BackRequest = errors.New("User requested to return to a previous menu.")
View Source
var ExitRequest = errors.New("User requested to exit the program.")

Functions

func AlwaysValid

func AlwaysValid(input string) (string, string, bool)

AlwaysValid is a special isValid function that check nothing

func Close

func Close()

func DisplayResult

func DisplayResult(message []string, uiEvents <-chan ui.Event, menus chan<- string) (string, error)

DisplayResult opens a new window and displays a message. each item in the message array will be displayed on a single line.

func Init

func Init() error

func PromptConfirmation

func PromptConfirmation(message string, uiEvents <-chan ui.Event, menus chan<- string) (bool, error)

func PromptTextInput

func PromptTextInput(introwords string, isValid validCheck, uiEvents <-chan ui.Event, menus chan<- string) (string, error)

PromptTextInput opens a new input window with fixed width=100, hight=1.

Types

type Entry

type Entry interface {
	// Label returns the string will show in menu.
	Label() string
}

Entry contains all the information needed for a boot entry.

func PromptMenuEntry

func PromptMenuEntry(menuTitle string, introwords string, entries []Entry, uiEvents <-chan ui.Event, menus chan<- string, customWarning ...string) (Entry, error)

PromptMenuEntry presents all entries into a menu with numbers. user inputs a number to choose from them. customWarning allow self-defined warnings in the menu for example the wifi menu want to show specific warning when user hit a specific entry, because some wifi's type may not be supported.

type Progress

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

func NewProgress

func NewProgress(text string, animated bool) Progress

func (*Progress) Close

func (p *Progress) Close()

func (*Progress) Update

func (p *Progress) Update(text string)

Jump to

Keyboard shortcuts

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