vm

package
v0.0.0-...-a68c302 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultRegistry

func DefaultRegistry(name string) (string, error)

func ParseRef

func ParseRef(image string) (name, version string, err error)

func Register

func Register(name string, p Provider)

func Remove

func Remove(ref Ref) error

func Validate

func Validate(name, version, canonicalArch string) error

Validate looks up the named provider and checks version+arch before any I/O.

Types

type BootConfig

type BootConfig = boot.Config

type Image

type Image struct {
	Image   string
	Paths   Paths
	OutPath string
}

func Pull

func Pull(ref Ref) (*Image, error)

Pull downloads and converts a VM image described by ref.

type Paths

type Paths struct {
	Dir   string
	Disk  string
	Cache string
}

func ResolvePaths

func ResolvePaths(ref Ref) (Paths, error)

type Provider

type Provider interface {
	DefaultRegistry() string
	BuildURL(reg, version, arch string) string
	// Validate returns a descriptive error for any unsupported version or arch
	// before a download is attempted.
	Validate(version, arch string) error
	// BootConfig returns the partition and filename patterns needed to extract
	// the kernel and initrd from a pulled disk image.
	BootConfig(version, arch string) (BootConfig, error)
}

Provider is implemented by each distro sub-package.

type Ref

type Ref struct {
	Image         string
	Registry      string
	Arch          string
	Dir           string
	ExtractKernel bool // extract vmlinuz and initrd alongside the disk image
}

Directories

Path Synopsis
vm/boot/boot.go
vm/boot/boot.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL