config

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArchiveFragment

type ArchiveFragment struct {
	HostFilename string `json:"host_filename" yaml:"host_filename"`
	Target       string `json:"target" yaml:"target"`
}

type BuilderConfig

type BuilderConfig struct {
	HostAddress    string
	Commands       []string
	OutputFilename string
}

type BuiltinFragment

type BuiltinFragment struct {
	Name          string `json:"builtin" yaml:"builtin"`
	GuestFilename string `json:"guest_filename" yaml:"guest_filename"`
}

type FileContentsFragment

type FileContentsFragment struct {
	Contents      []byte `json:"contents" yaml:"contents"`
	GuestFilename string `json:"guest_filename" yaml:"guest_filename"`
	Executable    bool   `json:"executable" yaml:"executable"`
}

type Fragment

type Fragment struct {
	// Not supported by TinyRange directly.
	RunCommand   *RunCommandFragment   `json:"run_command" yaml:"run_command"`
	LocalFile    *LocalFileFragment    `json:"local_file" yaml:"local_file"`
	FileContents *FileContentsFragment `json:"file_contents" yaml:"file_contents"`
	Archive      *ArchiveFragment      `json:"archive" yaml:"archive"`
	Builtin      *BuiltinFragment      `json:"builtin" yaml:"builtin"`
}

type LocalFileFragment

type LocalFileFragment struct {
	HostFilename  string `json:"host_filename" yaml:"host_filename"`
	GuestFilename string `json:"guest_filename" yaml:"guest_filename"`
	Executable    bool   `json:"executable" yaml:"executable"`
}

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 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"`
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳