Documentation ¶
Index ¶
- func BackendNames() []string
- func GzipDecompressor(dst io.Writer, src io.Reader) error
- func InMachine() (ret bool)
- func NullDecompressor(dst io.Writer, src io.Reader) error
- func Supported() bool
- func XzDecompressor(dst io.Writer, src io.Reader) error
- func ZstdDecompressor(dst io.Writer, src io.Reader) error
- type Arch
- type Machine
- func (m *Machine) AddVolume(directory string)
- func (m *Machine) AddVolumeAt(hostDirectory, machineDirectory string)
- func (m *Machine) CreateImage(imagepath string, size int64) (string, error)
- func (m *Machine) CreateImageWithLabel(path string, size int64, label string) (string, error)
- func (m *Machine) Run(command string) (int, error)
- func (m *Machine) RunInMachine() (int, error)
- func (m *Machine) RunInMachineWithArgs(args []string) (int, error)
- func (m *Machine) SetEnviron(environ []string)
- func (m *Machine) SetMemory(memory int)
- func (m *Machine) SetNumCPUs(numcpus int)
- func (m *Machine) SetQuiet(quiet bool)
- func (m *Machine) SetScratch(scratchsize int64, path string)
- func (m *Machine) SetShowBoot(showBoot bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BackendNames ¶
func BackendNames() []string
A list of backends which are implemented - sorted in order in which the * "auto" backend chooses them.
Types ¶
type Machine ¶
type Machine struct { Environ []string // contains filtered or unexported fields }
func NewMachine ¶
Create a new machine object with the auto backend
func NewMachineWithBackend ¶
Create a new machine object
func (*Machine) AddVolume ¶
AddVolume mounts directory from the host at the same location in the fake machine
func (*Machine) AddVolumeAt ¶
AddVolumeAt mounts hostDirectory from the host at machineDirectory in the fake machine
func (*Machine) CreateImage ¶
CreateImage does the same as CreateImageWithLabel but lets the library pick the label.
func (*Machine) CreateImageWithLabel ¶
CreateImageWithLabel creates an image file at path a given size and exposes it in the fake machine using the given label as the serial id. If size is -1 then the image should already exist and the size isn't modified.
label needs to be less then 20 characters due to limitations from qemu
The returned string is the device path of the new image as seen inside fakemachine.
func (*Machine) RunInMachine ¶
RunInMachine runs the caller binary inside the fakemachine with the same commandline arguments as the parent
func (*Machine) RunInMachineWithArgs ¶
RunInMachineWithArgs runs the caller binary inside the fakemachine with the specified commandline arguments
func (*Machine) SetEnviron ¶
func (*Machine) SetMemory ¶
SetMemory sets the fakemachines amount of memory (in megabytes). Defaults to 2048 MB
func (*Machine) SetNumCPUs ¶
SetNumCPUs sets the number of CPUs exposed to the fakemachine. Defaults to the number of available cores in the system.
func (*Machine) SetQuiet ¶ added in v0.0.4
SetQuiet sets whether fakemachine should print additional information (e.g. the command to be ran) or just print the stdout/stderr of the command to be ran.
func (*Machine) SetScratch ¶
SetScratch sets the size and location of on-disk scratch space to allocate (sparsely) for /scratch. If not set /scratch will be backed by memory. If Path is "" then the working directory is used as a default storage location
func (*Machine) SetShowBoot ¶
SetShowBoot sets whether to show boot/console messages from the fakemachine.