Documentation ¶
Overview ¶
Package menu displays a Terminal UI based text menu to choose boot options from.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry interface { // Label is the string displayed to the user in the menu. Label() string // Load is called when the entry is chosen, but does not transfer // execution to another process or kernel. Load() error // Exec transfers execution to another process or kernel. // // Exec either returns an error or does not return at all. Exec() error // IsDefault indicates that this action should be run by default if the // user didn't make an entry choice. IsDefault() bool }
Entry is a menu entry.
func Choose ¶
Choose presents the user a menu on input to choose an entry from and returns that entry.
func ShowMenuAndLoad ¶
ShowMenuAndLoad lets the user choose one of entries and loads it. If no entry is chosen by the user, an entry whose IsDefault() is true will be returned.
The user is left to call Entry.Exec when this function returns.
type OSImageAction ¶
OSImageAction is a menu.Entry that boots an OSImage.
func (OSImageAction) IsDefault ¶
func (OSImageAction) IsDefault() bool
IsDefault returns true -- this action should be performed in order by default if the user did not choose a boot entry.
func (OSImageAction) Load ¶
func (oia OSImageAction) Load() error
Load implements Entry.Load by loading the OS image into memory.
type Reboot ¶
type Reboot struct{}
Reboot is a menu.Entry that reboots the machine.
type StartShell ¶
type StartShell struct{}
StartShell is a menu.Entry that starts a LinuxBoot shell.
func (StartShell) Exec ¶
func (StartShell) Exec() error
Exec implements Entry.Exec by running /bin/defaultsh.
func (StartShell) IsDefault ¶
func (StartShell) IsDefault() bool
IsDefault indicates that this should not be run as a default action.