menusystem

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AskPassword

func AskPassword() (password string)

func AskText

func AskText(promptText string, helpText string) (theText string)

func Clear

func Clear()
func MenuItemNotImplemented(values ...any) error

func ValidMenuOption

func ValidMenuOption(length int) survey.Validator

ValidMenuOption requires a valid number or the empty string (pressing Enter)

func WaitAnyKey

func WaitAnyKey()

Types

type HandlerFunc

type HandlerFunc func(...any) error

The HandlerFunc type is an adapter to allow the use of ordinary functions as Menu handlers. If f is a function with the appropriate signature, HandlerFunc(f) is a Handler that calls f.

func (HandlerFunc) CallF

func (f HandlerFunc) CallF(values ...any) error

ServeHTTP calls f(w, r).

type Menu struct {
	Title         string
	NumberColor   pterm.Color
	LabelColor    pterm.Color
	MenuItems     []MenuItem
	PromptOptions []survey.AskOpt
	// contains filtered or unexported fields
}
func (m *Menu) PrintMenu(values ...any) error
type MenuItem struct {
	Title  string
	Action HandlerFunc
}

Jump to

Keyboard shortcuts

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