Documentation
¶
Overview ¶
Package sources provides image download sources for core-devops.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CDNSource ¶
type CDNSource struct {
// contains filtered or unexported fields
}
CDNSource downloads images from a CDN or S3 bucket.
func NewCDNSource ¶
func NewCDNSource(cfg SourceConfig) *CDNSource
NewCDNSource creates a new CDN source.
func (*CDNSource) Download ¶
func (s *CDNSource) Download(ctx context.Context, dest string, progress func(downloaded, total int64)) error
Download downloads the image from CDN.
func (*CDNSource) LatestVersion ¶
LatestVersion fetches version from manifest or returns "latest".
type GitHubSource ¶
type GitHubSource struct {
// contains filtered or unexported fields
}
GitHubSource downloads images from GitHub Releases.
func NewGitHubSource ¶
func NewGitHubSource(cfg SourceConfig) *GitHubSource
NewGitHubSource creates a new GitHub source.
func (*GitHubSource) Available ¶
func (s *GitHubSource) Available() bool
Available checks if gh CLI is installed and authenticated.
func (*GitHubSource) Download ¶
func (s *GitHubSource) Download(ctx context.Context, dest string, progress func(downloaded, total int64)) error
Download downloads the image from the latest release.
func (*GitHubSource) LatestVersion ¶
func (s *GitHubSource) LatestVersion(ctx context.Context) (string, error)
LatestVersion returns the latest release tag.
type ImageSource ¶
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, dest string, progress func(downloaded, total int64)) error
}
ImageSource defines the interface for downloading dev images.
Click to show internal directories.
Click to hide internal directories.