Documentation ¶
Index ¶
- Constants
- func CheckMachine(machine string) error
- func CheckUpdate() bool
- func CheckVBInstalled() error
- func StopMachines(quiet bool) error
- func Update() error
- type ArchConfig
- type Config
- func (vc *Config) CPUDialog()
- func (vc *Config) DescriptionDialog()
- func (vc Config) Enable(dst, template, device string) []Config
- func (vc Config) FromJSON(dst string) []Config
- func (vc *Config) GetCPU() int
- func (vc *Config) GetDescription() string
- func (vc *Config) GetMemory() int
- func (vc *Config) GetName() string
- func (vc *Config) GetUSBs() (usb, ehci, xhci OnOff)
- func (vc *Config) GetVbox(device string, quiet bool) (*virtualbox.Machine, error)
- func (vc *Config) Machine() (*virtualbox.Machine, error)
- func (vc *Config) MemoryDialog()
- func (vc *Config) Modify() error
- func (vc *Config) NameDialog()
- func (vc *Config) Stop(quiet bool) error
- func (vc *Config) ToJSON() string
- func (vc *Config) USBDialog()
- func (vc *Config) WriteToFile(dst string)
- type OnOff
- type USBController
- type USBTypeController
Constants ¶
const ( VBoxName = "iotit-box" VBoxIP = "localhost" VBoxUser = "root" VBoxPassword = "" VBoxSSHPort = "2222" VBoxConfFile = "iotit-vbox.json" )
VirtualBox location and connection details variables
const ( VBoxTypeDefault = iota VBoxTypeNew VBoxTypeUser )
vbox types
Variables ¶
This section is empty.
Functions ¶
func CheckMachine ¶
CheckMachine checks if any vbox is running with the ability to power-off After that imports and runs the vbox image according to the selected device type
func CheckVBInstalled ¶
func CheckVBInstalled() error
CheckVBInstalled checks for virtualbox dependencies
Types ¶
type ArchConfig ¶
type ArchConfig struct { CPU uint `json:"cpu"` Memory uint `json:"memory"` USB USBController `json:"usb"` }
ArchConfig represents basic VM settings
type Config ¶
type Config struct { Name string `json:"name"` UUID string `json:"uuid"` Template string `json:"template"` Device string `json:"device"` Description string `json:"description"` Option ArchConfig `json:"option"` SSH ssh_helper.Util }
Config represents Vbox parameters with ssh and http configurations
func NewConfig ¶
NewConfig returns new VirtualBox wrapper, containing helper functions to copy into vbox and dowload from it Run commands over ssh and get Virtual box configuration files
func (*Config) DescriptionDialog ¶
func (vc *Config) DescriptionDialog()
DescriptionDialog asks for VM description
func (*Config) GetDescription ¶
GetDescription returns description of the VM
func (*Config) Machine ¶
func (vc *Config) Machine() (*virtualbox.Machine, error)
Machine wraps virtualbox.GetMachine
func (*Config) WriteToFile ¶
WriteToFile writes JSON to file
type USBController ¶
type USBController struct { USB OnOff `json:"vc"` USBType USBTypeController `json:"type"` }
USBController represents USB settings
type USBTypeController ¶
USBTypeController represents USB type settings