Documentation ¶
Index ¶
- Variables
- func LongPipe() (io.ReadCloser, io.WriteCloser, error)
- func MonitorExecution(outc <-chan []byte, errc <-chan error, local, needOutput bool, ...) (desc string, text, output []byte, crashed, timedout bool)
- func OpenAdbConsole(bin, dev string) (rc io.ReadCloser, err error)
- func OpenConsole(con string) (rc io.ReadCloser, err error)
- func Register(typ string, ctor ctorFunc)
- func SleepInterruptible(d time.Duration) bool
- type Config
- type Instance
- type OutputMerger
Constants ¶
This section is empty.
Variables ¶
View Source
var Shutdown = make(chan struct{})
Close to interrupt all pending operations.
View Source
var TimeoutErr = errors.New("timeout")
Functions ¶
func LongPipe ¶
func LongPipe() (io.ReadCloser, io.WriteCloser, error)
func MonitorExecution ¶
func OpenAdbConsole ¶
func OpenAdbConsole(bin, dev string) (rc io.ReadCloser, err error)
OpenAdbConsole provides fallback console output using 'adb shell dmesg -w'.
func OpenConsole ¶
func OpenConsole(con string) (rc io.ReadCloser, err error)
Tested on Suzy-Q and BeagleBone.
func SleepInterruptible ¶
Sleep for d. If shutdown is in progress, return false prematurely.
Types ¶
type Config ¶
type Config struct { Name string Index int Workdir string Bin string BinArgs string Initrd string Kernel string Cmdline string Image string Sshkey string Executor string Device string MachineType string OdroidHostAddr string OdroidSlaveAddr string OdroidConsole string OdroidHubBus int OdroidHubDevice int OdroidHubPort int Cpu int Mem int Debug bool }
type Instance ¶
type Instance interface { // Copy copies a hostSrc file into vm and returns file name in vm. Copy(hostSrc string) (string, error) // Forward setups forwarding from within VM to host port port // and returns address to use in VM. Forward(port int) (string, error) // Run runs cmd inside of the VM (think of ssh cmd). // outc receives combined cmd and kernel console output. // errc receives either command Wait return error or vm.TimeoutErr. // Command is terminated after timeout. Send on the stop chan can be used to terminate it earlier. Run(timeout time.Duration, stop <-chan bool, command string) (outc <-chan []byte, errc <-chan error, err error) // Close stops and destroys the VM. Close() }
Instance represents a Linux VM or a remote physical machine.
type OutputMerger ¶
type OutputMerger struct { Output chan []byte Err chan error // contains filtered or unexported fields }
func NewOutputMerger ¶
func NewOutputMerger(tee io.Writer) *OutputMerger
func (*OutputMerger) Add ¶
func (merger *OutputMerger) Add(name string, r io.ReadCloser)
func (*OutputMerger) Wait ¶
func (merger *OutputMerger) Wait()
Click to show internal directories.
Click to hide internal directories.