package
0.0.0-20230205200448-60bfe13edb27
Repository: https://github.com/u-root/webboot.git
Documentation: pkg.go.dev

# README

Usage

The webboot program would do the following:

  • Present a menu with the existing cached distro options
  • If the user wants a distro that is not cached, they can download an ISO
  • After the user decides on an ISO, boot it.

Test

Our UI uses a package called Termui. Termui will parse the standard input into keyboard events and insert them into a channel, then from which the Termui get it's input. For implement a unattended test, I manually build a series of keyboard events that reperesent my intented input for test, and insert them into a channel. Then I replace the original input channel with my channel in the test. So the go test could run a test of ui automatically.

See TestDownloadOption for an example:

  • create a channel by make(chan ui.Event).
  • use go pressKey(uiEvents, input) to translate the intented test input to keyboard events and push them to the uiEvents chanel.
  • use the uiEvents channel by call downloadOption.exec(uiEvents). (Main function will always call ui.PollEvents() to get the sandard input channel)
  • all functions involving in ui input will provide a argument to indicate the input chanel.

Hint

If want to set up a cached directory in side the USB stick, the file structure of USB stick should be +-- USB root | +-- Images (<--- the cache directory. It must be named as "Images") | +-- subdirectories or iso files ...

# Functions

No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
Config represents one kind of configure of booting an iso.
DirOption represents a directory under cache directory.
No description provided by the author
DownloadOption lets the user download an iso then boot it.
No description provided by the author
ISO contains information of the iso user wants to boot.
No description provided by the author
No description provided by the author
No description provided by the author
WriteCounter counts the number of bytes written to it.