Documentation
¶
Index ¶
- Constants
- Variables
- type AddInitScriptFragment
- type AddVolumeFragment
- type ArchiveFragment
- type BuilderConfig
- type BuiltinFragment
- type CPUArchitecture
- type DefaultInteractiveFragment
- type EnvironmentFragment
- type ExportPortFragment
- type FileContentsFragment
- type Filesystem
- type FilesystemKind
- type Fragment
- type InteractionKind
- type KernelFragment
- type LocalFileFragment
- type MountHostDirectoryFragment
- type RunCommandFragment
- type RunStarlarkScriptFragment
- type StartServiceCommandFragment
- type TinyRangeConfig
Constants ¶
View Source
const INSECURE_SSH_PASSWORD = "insecurepassword"
Used as the default password when one is not provided.
Variables ¶
View Source
var HostArchitecture = getHostArchitecture()
Functions ¶
This section is empty.
Types ¶
type AddInitScriptFragment ¶ added in v0.1.8
type AddInitScriptFragment struct {
GuestFilename string `json:"guest_filename" yaml:"guest_filename"`
}
type AddVolumeFragment ¶ added in v0.2.5
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 Filesystem ¶ added in v0.2.0
type Filesystem struct { // The kind of filesystem to create. Kind FilesystemKind `json:"kind" yaml:"kind"` // A list of Fragments to add to the Filesystem. Fragments []Fragment `json:"rootfs_fragments" yaml:"rootfs_fragments"` // The size of the rootfs in megabytes. StorageSize int `json:"storage_size" yaml:"storage_size"` // The path to persist the filesystem to. This creates a raw image and remounts it on subsequent runs. PersistPath string `json:"persist_path" yaml:"persist_path"` }
type FilesystemKind ¶ added in v0.2.0
type FilesystemKind string
const ( FilesystemKindRaw FilesystemKind = "raw" FilesystemKindExt4 FilesystemKind = "ext4" )
type Fragment ¶
type Fragment struct { // Not supported by TinyRange directly. RunCommand *RunCommandFragment `json:"run_command,omitempty" yaml:"run_command"` StartServiceCommand *StartServiceCommandFragment `json:"start_service,omitempty" yaml:"start_service"` AddInitScript *AddInitScriptFragment `json:"add_init_script,omitempty" yaml:"add_init_script"` Environment *EnvironmentFragment `json:"environment,omitempty" yaml:"environment"` RunStarlarkScript *RunStarlarkScriptFragment `json:"run_starlark_script,omitempty" yaml:"run_starlark_script"` // Supported Directly DefaultInteractive *DefaultInteractiveFragment `json:"interactive,omitempty" yaml:"interactive"` 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"` AddVolume *AddVolumeFragment `json:"add_volume,omitempty" yaml:"add_volume"` }
type InteractionKind ¶ added in v0.2.0
type InteractionKind string
const ( InteractionSSH InteractionKind = "ssh" InteractionSerial InteractionKind = "serial" InteractionVNC InteractionKind = "vnc" InteractionWebSSH InteractionKind = "webssh" InteractionWebSSHMinimal InteractionKind = "webssh,minimal" InteractionWebSSHNoBrower InteractionKind = "webssh,nobrowser" )
type KernelFragment ¶ added in v0.1.0
type LocalFileFragment ¶
type MountHostDirectoryFragment ¶ added in v0.1.0
type RunCommandFragment ¶
type RunStarlarkScriptFragment ¶ added in v0.2.3
type RunStarlarkScriptFragment struct {
Script string `json:"script" yaml:"script"`
}
type StartServiceCommandFragment ¶ added in v0.2.0
type StartServiceCommandFragment 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 Architecture of the root filesystem. This is a hint to enable vmm-specific optimizations. RootArchitecture CPUArchitecture `json:"root_architecture" yaml:"root_architecture"` // 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 filesystems to create. Filesystems map[string]Filesystem `json:"filesystems" yaml:"filesystems"` // The way the user will interact with the virtual machine (options: [ssh, serial], default: ssh). Interaction InteractionKind `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"` // 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.