Documentation ¶
Index ¶
- Variables
- type CreateVirtualMachineOptions
- type Engine
- func (e *Engine) CreateVirtualMachine(opts CreateVirtualMachineOptions) (*VirtualMachine, error)
- func (e *Engine) FindImage(name string) *Image
- func (e *Engine) FindVirtualMachine(name string) *VirtualMachine
- func (eng *Engine) ListImages() []*Image
- func (e *Engine) ListVirtualMachines() []*VirtualMachine
- func (e *Engine) Printf(format string, a ...interface{}) (n int, err error)
- func (e *Engine) RandomLocallyAdministeredMacAddress() (string, error)
- type Image
- type ImageArch
- type NewOptions
- type SSHConnectionDetails
- type VirtualMachine
- func (v *VirtualMachine) Exec(cmd string) error
- func (v *VirtualMachine) Remove() error
- func (v *VirtualMachine) SSHConnectionDetails() (*SSHConnectionDetails, error)
- func (v *VirtualMachine) SSHSessionWithXterm() error
- func (v *VirtualMachine) Start() error
- func (v *VirtualMachine) Status() (VirtualMachineStatus, error)
- func (v *VirtualMachine) Stop() error
- type VirtualMachineConfig
- type VirtualMachineStatus
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrImageNotFound = errors.New("engine: image not found") ErrInvalidChecksum = errors.New("engine: invalid checksum") ErrInvalidSSHPort = errors.New("engine: invalid ssh port") ErrUnsupportedArchitecture = errors.New("engine: unsupported architecture") ErrVirtualMachineAlreadyExist = errors.New("engine: virtual machine already exist") ErrVirtualMachineAlreadyRunning = errors.New("engine: virtual machine is already running") ErrVirtualMachineNotRunning = errors.New("engine: virtual machine is not running") )
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func New ¶
func New(opts *NewOptions) (*Engine, error)
func (*Engine) CreateVirtualMachine ¶
func (e *Engine) CreateVirtualMachine(opts CreateVirtualMachineOptions) (*VirtualMachine, error)
CreateVirtualMachine creates and start a new virtual machine
func (*Engine) FindVirtualMachine ¶
func (e *Engine) FindVirtualMachine(name string) *VirtualMachine
FindVirtualMachine returns the virtual machine if exist
func (*Engine) ListImages ¶
func (*Engine) ListVirtualMachines ¶
func (e *Engine) ListVirtualMachines() []*VirtualMachine
ListVirtualMachines returns a slice of loaded virtual machines
func (*Engine) RandomLocallyAdministeredMacAddress ¶
type Image ¶
type SSHConnectionDetails ¶
type VirtualMachine ¶
type VirtualMachine struct { Name string Config VirtualMachineConfig // contains filtered or unexported fields }
func (*VirtualMachine) Exec ¶
func (v *VirtualMachine) Exec(cmd string) error
func (*VirtualMachine) Remove ¶
func (v *VirtualMachine) Remove() error
Remove stops and remove the virtual machine
func (*VirtualMachine) SSHConnectionDetails ¶
func (v *VirtualMachine) SSHConnectionDetails() (*SSHConnectionDetails, error)
func (*VirtualMachine) SSHSessionWithXterm ¶
func (v *VirtualMachine) SSHSessionWithXterm() error
func (*VirtualMachine) Start ¶
func (v *VirtualMachine) Start() error
Start starts the virtual machine
func (*VirtualMachine) Status ¶
func (v *VirtualMachine) Status() (VirtualMachineStatus, error)
Status returns the status of the virtual machine
type VirtualMachineConfig ¶
type VirtualMachineStatus ¶
type VirtualMachineStatus string
const ( VirtualMachineStatusStopped VirtualMachineStatus = "stopped" VirtualMachineStatusRunning VirtualMachineStatus = "running" VirtualMachineStatusError VirtualMachineStatus = "error" )
Click to show internal directories.
Click to hide internal directories.