Documentation
¶
Index ¶
- Variables
- type ArchiveFragment
- type BuilderConfig
- type BuiltinFragment
- type CPUArchitecture
- type DefaultInteractiveFragment
- type EnvironmentFragment
- type ExportPortFragment
- type FileContentsFragment
- type Fragment
- type KernelFragment
- type LocalFileFragment
- type MountHostDirectoryFragment
- type RunCommandFragment
- type TinyRangeConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var HostArchitecture = getHostArchitecture()
Functions ¶
This section is empty.
Types ¶
type ArchiveFragment ¶
type BuilderConfig ¶
type BuiltinFragment ¶
type BuiltinFragment struct { Name string `json:"builtin" yaml:"builtin"` Architecture CPUArchitecture `json:"architecture" yaml:"architecture"` GuestFilename string `json:"guest_filename" yaml:"guest_filename"` }
type CPUArchitecture ¶ added in v0.1.0
type CPUArchitecture string
const ( ArchInvalid CPUArchitecture = "" ArchX8664 CPUArchitecture = "x86_64" ArchARM64 CPUArchitecture = "aarch64" )
func ArchitectureFromString ¶ added in v0.1.0
func ArchitectureFromString(s string) (CPUArchitecture, error)
func (CPUArchitecture) IsNative ¶ added in v0.1.0
func (arch CPUArchitecture) IsNative() bool
type DefaultInteractiveFragment ¶ added in v0.1.0
type DefaultInteractiveFragment struct {
Args []string `json:"args"`
}
type EnvironmentFragment ¶ added in v0.1.0
type EnvironmentFragment struct {
Variables []string `json:"variables" yaml:"variables"`
}
type ExportPortFragment ¶ added in v0.1.0
type FileContentsFragment ¶
type Fragment ¶
type Fragment struct { // Not supported by TinyRange directly. RunCommand *RunCommandFragment `json:"run_command,omitempty" yaml:"run_command"` DefaultInteractive *DefaultInteractiveFragment `json:"interactive,omitempty" yaml:"interactive"` Environment *EnvironmentFragment `json:"environment,omitempty" yaml:"environment"` LocalFile *LocalFileFragment `json:"local_file,omitempty" yaml:"local_file"` FileContents *FileContentsFragment `json:"file_contents,omitempty" yaml:"file_contents"` Archive *ArchiveFragment `json:"archive,omitempty" yaml:"archive"` Builtin *BuiltinFragment `json:"builtin,omitempty" yaml:"builtin"` ExportPort *ExportPortFragment `json:"export_port,omitempty" yaml:"export_port"` MountHostDirectory *MountHostDirectoryFragment `json:"mount_host_directory,omitempty" yaml:"mount_host_directory"` Kernel *KernelFragment `json:"kernel,omitempty" yaml:"kernel"` }
type KernelFragment ¶ added in v0.1.0
type LocalFileFragment ¶
type MountHostDirectoryFragment ¶ added in v0.1.0
type MountHostDirectoryFragment struct {
HostDirectory string `json:"host_directory" yaml:"host_directory"`
}
type RunCommandFragment ¶
type RunCommandFragment struct {
Command string `json:"command" yaml:"command"`
}
type TinyRangeConfig ¶
type TinyRangeConfig struct { // The base directory all other filenames resolve from. BaseDirectory string `json:"base_directory" yaml:"base_directory"` // The CPU Architecture of the guest. Architecture CPUArchitecture `json:"architecture" yaml:"architecture"` // The filename of the hypervisor starlark script to use. HypervisorScript string `json:"hypervisor_script" yaml:"hypervisor_script"` // The kernel to boot. KernelFilename string `json:"kernel_filename" yaml:"kernel_filename"` // A initramfs to pass to the kernel or "" to disable passing a initramfs. InitFilesystemFilename string `json:"init_filesystem_filename" yaml:"init_filesystem_filename"` // A list of RootFsFragments. RootFsFragments []Fragment `json:"rootfs_fragments" yaml:"rootfs_fragments"` // The size of the rootfs in megabytes. StorageSize int `json:"storage_size" yaml:"storage_size"` // The way the user will interact with the virtual machine (options: [ssh, serial], default: ssh). Interaction string `json:"interaction" yaml:"interaction"` // The number of CPU cores to allocate to the virtual machine. CPUCores int `json:"cpu_cores" yaml:"cpu_cores"` // The amount of memory to allocate to the virtual machine. MemoryMB int `json:"memory_mb" yaml:"memory_mb"` // Config parameters to pass to the hypervisor. HypervisorConfig map[string]string `json:"hypervisor_config" yaml:"hypervisor_config"` // Redirect hypervisor input to the host. The VM will exit after it completes initialization. Debug bool `json:"debug" yaml:"debug"` }
A config file that can be passed to TinyRange to configure and execute a virtual machine.
func (TinyRangeConfig) Resolve ¶
func (cfg TinyRangeConfig) Resolve(filename string) string
Click to show internal directories.
Click to hide internal directories.