cli/pkg/devops/sources/source.go
Snider abdb479b5f chore(io): Fix merge conflicts and address PR feedback
- Resolved merge conflicts with latest dev branch.
- Restored Medium abstraction in pkg/cli/daemon.go and context checks in pkg/container/linuxkit.go.
- Refactored pkg/repos/registry.go to be truly medium-agnostic (removed filepath.Abs).
- Updated pkg/cli/daemon_test.go to use MockMedium.
- Verified all builds and tests pass locally.
2026-02-04 15:22:55 +00:00

33 lines
963 B
Go

// Package sources provides image download sources for core-devops.
package sources
import (
"context"
"github.com/host-uk/core/pkg/io"
)
// ImageSource defines the interface for downloading dev images.
type ImageSource interface {
// Name returns the source identifier.
Name() string
// Available checks if this source can be used.
Available() bool
// LatestVersion returns the latest available version.
LatestVersion(ctx context.Context) (string, error)
// Download downloads the image to the destination path.
// Reports progress via the callback if provided.
Download(ctx context.Context, m io.Medium, dest string, progress func(downloaded, total int64)) error
}
// SourceConfig holds configuration for a source.
type SourceConfig struct {
// GitHub configuration
GitHubRepo string
// Registry configuration
RegistryImage string
// CDN configuration
CDNURL string
// Image name (e.g., core-devops-darwin-arm64.qcow2)
ImageName string
}