imagerepository

package
v1.28.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudImage

type CloudImage struct {
	ID           string  `json:"id"`
	Name         string  `json:"name"`
	URL          string  `json:"url"`
	ChecksumURL  string  `json:"checksum_url,omitempty"`
	SizeGB       float64 `json:"size_gb"`
	Type         string  `json:"type"`
	OS           string  `json:"os"`
	Version      string  `json:"version"`
	Description  string  `json:"description"`
	Architecture string  `json:"architecture"`
}

CloudImage represents a downloadable cloud image

type ImageRepository

type ImageRepository struct {
	StoragePath string
	Images      []CloudImage
}

ImageRepository manages cloud image downloads

func NewImageRepository

func NewImageRepository(storagePath string) *ImageRepository

NewImageRepository creates a new image repository

func (*ImageRepository) DownloadImage

func (r *ImageRepository) DownloadImage(imageID string, progressCallback func(downloaded, total int64)) error

DownloadImage downloads a cloud image with checksum verification

func (*ImageRepository) GetDownloadedImagePath

func (r *ImageRepository) GetDownloadedImagePath(imageID string) string

GetDownloadedImagePath returns the path to a downloaded image

func (*ImageRepository) GetImages

func (r *ImageRepository) GetImages() []CloudImage

GetImages returns all available cloud images

func (*ImageRepository) GetImagesByOS

func (r *ImageRepository) GetImagesByOS(osName string) []CloudImage

GetImagesByOS returns images filtered by operating system

func (*ImageRepository) IsImageDownloaded

func (r *ImageRepository) IsImageDownloaded(imageID string) bool

IsImageDownloaded checks if an image is already downloaded

Jump to

Keyboard shortcuts

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