Documentation
¶
Index ¶
- type CloudImage
- type ImageRepository
- func (r *ImageRepository) DownloadImage(imageID string, progressCallback func(downloaded, total int64)) error
- func (r *ImageRepository) GetDownloadedImagePath(imageID string) string
- func (r *ImageRepository) GetImages() []CloudImage
- func (r *ImageRepository) GetImagesByOS(osName string) []CloudImage
- func (r *ImageRepository) IsImageDownloaded(imageID string) bool
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
Click to show internal directories.
Click to hide internal directories.