types

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 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 BootAssets

type BootAssets struct {
	Kernel  io.ReadCloser
	Initrd  io.ReadCloser
	Cmdline string
}

BootAssets contains kernel, initrd, and cmdline for kexec boot.

func (*BootAssets) Close

func (a *BootAssets) Close() error

Close releases all resources.

type ImageSource

type ImageSource interface {
	// Type returns the type of image source.
	Type() ImageSourceType

	// Reference returns the original image reference (path, URL, or container ref).
	Reference() string

	// GetBootAssets returns kernel, initrd, and cmdline for kexec boot.
	GetBootAssets() (*BootAssets, error)

	// GetInstallAssets returns data needed for installation.
	GetInstallAssets(tmpDir string, sizeGiB uint64) (*InstallAssets, error)

	// Close releases any resources held by the source.
	Close() error
}

ImageSource is an abstraction over different image sources.

type ImageSourceType

type ImageSourceType int

ImageSourceType represents the type of image source.

const (
	ImageSourceContainer ImageSourceType = iota // Container registry image (e.g., ghcr.io/...)
	ImageSourceISO                              // ISO file (local or HTTP)
	ImageSourceRAW                              // RAW disk image (local or HTTP), possibly XZ compressed
)

func (ImageSourceType) String

func (t ImageSourceType) String() string

type InstallAssets

type InstallAssets struct {
	// For container/ISO: path to extracted rootfs with installer
	RootfsPath string

	// For RAW: reader for disk image (possibly decompressed)
	DiskImage     io.ReadCloser
	DiskImageSize int64

	// Cleanup function to call after installation
	Cleanup func() error
}

InstallAssets contains data needed for installation.

func (*InstallAssets) Close

func (a *InstallAssets) Close() error

Close releases all resources.

Jump to

Keyboard shortcuts

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