Documentation
¶
Index ¶
- Variables
- func DownloadCacheDir() (string, error)
- func ExtractAll(archivePaths []string, destDir string, eventCh chan<- ExtractionEvent) error
- func PatchQtConf(installDir string) error
- func VerifyFile(path, expectedSHA1 string) error
- type DownloadEvent
- type Downloader
- type ExtractionEvent
- type Installer
- type Options
- type ProgressEvent
Constants ¶
This section is empty.
Variables ¶
var ErrUpToDate = errors.New("already up to date")
ErrUpToDate is returned by Install when the requested content is already installed and there is nothing new to download.
Functions ¶
func DownloadCacheDir ¶
DownloadCacheDir returns the centralized cache directory used to store in-progress (.part) and completed archive files across runs. On Windows: %LOCALAPPDATA%\qvm\downloads. On Linux: ~/.cache/qvm/downloads. On macOS: ~/Library/Caches/qvm/downloads.
func ExtractAll ¶
func ExtractAll(archivePaths []string, destDir string, eventCh chan<- ExtractionEvent) error
ExtractAll extracts all downloaded archives into destDir.
func PatchQtConf ¶
PatchQtConf writes (or rewrites) the qt.conf file in the installed Qt directory so that the Prefix points to the actual installation path. Qt archives do not ship a qt.conf; this step creates it.
func VerifyFile ¶
VerifyFile checks that the file at path has the expected SHA1 hex digest. If expectedSHA1 is empty, the check is skipped and nil is returned.
Types ¶
type DownloadEvent ¶
type DownloadEvent struct {
Filename string
BytesDone int64
BytesTotal int64
Speed float64 // bytes per second
Done bool
Err error
}
DownloadEvent is emitted as archives are downloaded.
type Downloader ¶
type Downloader struct {
// contains filtered or unexported fields
}
Downloader downloads archives in parallel with a bounded concurrency.
func NewDownloader ¶
func NewDownloader(concurrency, timeoutSeconds int, destDir string) *Downloader
NewDownloader creates a Downloader.
func (*Downloader) DownloadAll ¶
func (d *Downloader) DownloadAll( ctx context.Context, archives []repository.ArchiveRef, eventCh chan<- DownloadEvent, ) ([]string, error)
DownloadAll downloads all archives in parallel, emitting events on eventCh. Returns the local file paths in the same order as archives.
type ExtractionEvent ¶
ExtractionEvent is emitted during archive extraction.
type Installer ¶
type Installer struct {
// contains filtered or unexported fields
}
Installer orchestrates the download -> verify -> extract -> patch -> register pipeline.
func NewInstaller ¶
func NewInstaller(resolver *repository.Resolver, registry *storage.RegistryManager) *Installer
NewInstaller creates an Installer.
func (*Installer) Install ¶
func (inst *Installer) Install(ctx context.Context, opts Options, progressCh chan<- ProgressEvent) error
Install performs a full Qt SDK installation. The caller owns progressCh and is responsible for closing it after Install returns. Install only sends on the channel; it never closes it.
A per-install-directory lock is held for the entire pipeline so that two concurrent qvm processes targeting the same version+arch serialize their download/extract/register steps and never clobber each other's files. Parallel installs to *different* version+arch combinations are unaffected.
type Options ¶
type Options struct {
Version string
Arch string
Modules []string
Docs bool
Examples bool
Sources bool
DebugInfo bool
InstallRoot string // e.g. C:\Qt
Concurrency int
Timeout int // seconds
Force bool // re-install even if already installed
DryRun bool // resolve and report archives without downloading
}
Options configures a Qt SDK installation.
type ProgressEvent ¶
type ProgressEvent struct {
Phase string // "resolving", "downloading", "extracting", "patching", "registering"
Archive string // current archive name
Percent float64 // 0-100 overall progress
BytesDone int64
BytesTotal int64
Speed float64 // bytes/sec (download phase only)
ArchiveIndex int // 1-based index of the archive being processed (0 = unknown)
ArchiveTotal int // total number of archives in this install (0 = unknown)
Warning string // non-empty message when Phase == "warning"
}
ProgressEvent is emitted by the installer pipeline.