Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInterrupt = errors.New("Interrupt")
View Source
var ErrRestart = errors.New("Restart")
View Source
var SSH_CSS = html.Style(`
#terminal {
min-height: 300px;
max-height: 50vh;
}
div.fillScreen {
position: fixed;
top: 0;
left: 0;
max-height: 100vh !important;
z-index: 100;
}
button.fillScreen {
position: fixed;
bottom: 20px;
right: 20px;
z-index: 101;
}`)
View Source
var SSH_JS = html.JavaScript(sshJsRaw)
Functions ¶
func Entry ¶
func Entry( prepare func(vmm Driver) (PrepareResult, error), create func(vmm Driver) (VirtualMachineMonitor, error), )
Types ¶
type Driver ¶
type Driver interface { // FindExecutable finds the executable with the given name. // It looks beside the current executable first then searches the PATH. FindExecutable(name string) (string, error) // HostOperatingSystem returns the host operating system. HostOperatingSystem() string // GuestArchitecture returns the guest architecture. This is the architecture of the kernel and init. GuestArchitecture() config.CPUArchitecture // RootArchitecture returns the architecture of executables on the guest filesystem so emulation can be installed. RootArchitecture() config.CPUArchitecture // Accelerated returns true if the driver supports hardware acceleration. Accelerated() bool // CPUCount returns the number of CPU cores. CPUCores() int // MemorySize returns the memory size in MiB. MemoryMB() int // DiskImages returns a list of attached disk images. DiskImages() []File // InitRamFs returns the initial ramdisk filesystem or nil. InitRamFs() File // Verbose returns true if the driver is in verbose mode. Verbose() bool // Experimental returns the experimental flags. Experimental() []string // Interaction returns the interaction mode. Interaction() config.InteractionKind // NetworkInterface returns the network interface or nil. NetworkInterface() NetworkInterface // Kernel returns the kernel image. Kernel() File // EnsureFile ensures the file with the given name exists and has the given contents. EnsureFile(contents []byte) (File, error) }
type File ¶
type File interface { // GetNBDServer returns the NBD server address and the export name. // If unix is true, it returns a Unix domain socket path. // Otherwise, it returns a TCP address. GetNBDServer(unix bool) (net.Addr, string, error) // HostFilename writes the file to a temporary file and returns the path. HostFilename() (string, error) }
type Filesystem ¶
type NetworkInterface ¶
type NetworkInterface interface { // MACAddress returns the MAC address. MACAddress() net.HardwareAddr // GetUDPSocketPair returns a pair of UDP sockets one for sending L2 and one for receiving L2 packets. GetUDPSocketPair() (net.Addr, net.Addr, error) // AttachFile attaches a file to the network interface. AttachFile(file *os.File) error }
type PrepareResult ¶
type PrepareResult struct { }
type SecureSSHConfig ¶
type VirtualMachineMonitor ¶
type VirtualMachineMonitor interface { // Run starts the virtual machine. // If bindOutput is true, the output is bound to the current process. Run(bindOutput bool) error // Shutdown stops the virtual machine. Shutdown() error }
func NewExecutable ¶
func NewExecutable(name string, args []string) VirtualMachineMonitor
Click to show internal directories.
Click to hide internal directories.