source

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: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectCompression

func DetectCompression(path string) string

DetectCompression returns the compression type based on file extension.

func DetectImageSource

func DetectImageSource(ref string) (types.ImageSource, error)

DetectImageSource detects the image type and returns an appropriate ImageSource.

func DownloadToFile

func DownloadToFile(ctx context.Context, url, destPath string, onProgress ProgressFunc) error

DownloadToFile downloads a URL to a local file with optional progress reporting.

func FindInitrdPath

func FindInitrdPath(mountPoint string) string

FindInitrdPath searches for initrd in common locations.

func FindKernelPath

func FindKernelPath(mountPoint string) string

FindKernelPath searches for kernel in common locations.

func OpenDecompressed

func OpenDecompressed(path string) (io.ReadCloser, int64, error)

OpenDecompressed opens a file and returns a decompressed reader. Returns the reader, uncompressed size (-1 if unknown), and error.

Types

type ContainerSource

type ContainerSource struct {
	// contains filtered or unexported fields
}

ContainerSource implements ImageSource for container registry images.

func NewContainerSource

func NewContainerSource(ref string) *ContainerSource

NewContainerSource creates a new ContainerSource.

func (*ContainerSource) Close

func (s *ContainerSource) Close() error

func (*ContainerSource) GetBootAssets

func (s *ContainerSource) GetBootAssets() (*types.BootAssets, error)

GetBootAssets extracts kernel and initrd from UKI in container image.

func (*ContainerSource) GetInstallAssets

func (s *ContainerSource) GetInstallAssets(tmpDir string, _ uint64) (*types.InstallAssets, error)

GetInstallAssets extracts the full rootfs for chroot installation.

func (*ContainerSource) Reference

func (s *ContainerSource) Reference() string

func (*ContainerSource) Type

type HTTPSource

type HTTPSource struct {
	// contains filtered or unexported fields
}

HTTPSource wraps a remote image that needs to be downloaded first.

func NewHTTPSource

func NewHTTPSource(url string, targetType types.ImageSourceType) *HTTPSource

NewHTTPSource creates a new HTTPSource for downloading remote images.

func (*HTTPSource) Close

func (s *HTTPSource) Close() error

func (*HTTPSource) GetBootAssets

func (s *HTTPSource) GetBootAssets() (*types.BootAssets, error)

GetBootAssets downloads the image and delegates to appropriate source.

func (*HTTPSource) GetInstallAssets

func (s *HTTPSource) GetInstallAssets(tmpDir string, sizeGiB uint64) (*types.InstallAssets, error)

GetInstallAssets downloads the image and delegates to appropriate source.

func (*HTTPSource) Reference

func (s *HTTPSource) Reference() string

func (*HTTPSource) Type

func (s *HTTPSource) Type() types.ImageSourceType

type ISOSource

type ISOSource struct {
	// contains filtered or unexported fields
}

ISOSource implements ImageSource for ISO files.

func NewISOSource

func NewISOSource(path string) *ISOSource

NewISOSource creates a new ISOSource.

func (*ISOSource) Close

func (s *ISOSource) Close() error

func (*ISOSource) GetBootAssets

func (s *ISOSource) GetBootAssets() (*types.BootAssets, error)

GetBootAssets extracts kernel and initrd from ISO.

func (*ISOSource) GetInstallAssets

func (s *ISOSource) GetInstallAssets(tmpDir string, sizeGiB uint64) (*types.InstallAssets, error)

GetInstallAssets extracts the rootfs from ISO for chroot installation.

func (*ISOSource) Reference

func (s *ISOSource) Reference() string

func (*ISOSource) Type

func (s *ISOSource) Type() types.ImageSourceType

type ProgressFunc

type ProgressFunc func(current, total int64)

ProgressFunc is called during download to report progress.

type RAWSource

type RAWSource struct {
	// contains filtered or unexported fields
}

RAWSource implements ImageSource for RAW disk images.

func NewRAWSource

func NewRAWSource(path string) *RAWSource

NewRAWSource creates a new RAWSource.

func (*RAWSource) Close

func (s *RAWSource) Close() error

func (*RAWSource) GetBootAssets

func (s *RAWSource) GetBootAssets() (*types.BootAssets, error)

GetBootAssets extracts kernel and initrd from UKI in RAW image.

func (*RAWSource) GetInstallAssets

func (s *RAWSource) GetInstallAssets(tmpDir string, sizeGiB uint64) (*types.InstallAssets, error)

GetInstallAssets returns the RAW image for direct writing to disk.

func (*RAWSource) Reference

func (s *RAWSource) Reference() string

func (*RAWSource) Type

func (s *RAWSource) Type() types.ImageSourceType

Jump to

Keyboard shortcuts

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