go-container/sources/source.go
Snider 6c4050486b refactor(container): migrate module path to dappco.re/go/core/container
Update module path from forge.lthn.ai/core/go-container to
dappco.re/go/core/container. Migrate import paths for go-io (v0.2.0),
go-log (v0.1.0), and go-i18n (v0.2.0) to their new dappco.re
equivalents. cli and config remain at forge.lthn.ai (not yet migrated).

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 01:55:36 +00:00

33 lines
951 B
Go

// Package sources provides image download sources for container.
package sources
import (
"context"
"dappco.re/go/core/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
}