Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InstallError ¶
type InstallError struct {
Type InstallErrorType
Phase InstallPhase
Message string
Err error
}
InstallError represents a structured installation error
func (*InstallError) Error ¶
func (e *InstallError) Error() string
Error implements the error interface
func (*InstallError) Unwrap ¶
func (e *InstallError) Unwrap() error
Unwrap implements error unwrapping
type InstallErrorType ¶
type InstallErrorType string
InstallErrorType categorizes installation errors
const ( ErrorTypeFetch InstallErrorType = "fetch" ErrorTypeNotFound InstallErrorType = "not_found" ErrorTypeAlreadyInstalled InstallErrorType = "already_installed" ErrorTypeDownload InstallErrorType = "download" ErrorTypeExtract InstallErrorType = "extract" ErrorTypeVerification InstallErrorType = "verification" ErrorTypeChecksum InstallErrorType = "checksum" ErrorTypeNotInstalled InstallErrorType = "not_installed" ErrorTypePlatform InstallErrorType = "platform" )
type InstallPhase ¶
type InstallPhase string
InstallPhase represents the current phase of installation
const ( PhaseFetching InstallPhase = "fetching" PhaseValidating InstallPhase = "validating" PhaseDownloading InstallPhase = "downloading" PhaseExtracting InstallPhase = "extracting" PhaseVerifying InstallPhase = "verifying" PhaseComplete InstallPhase = "complete" )
type Installer ¶
type Installer struct {
Verbose bool
Quiet bool
KeepBuildPath bool
MirrorURL string
// contains filtered or unexported fields
}
Installer handles Go installation
func NewInstaller ¶
NewInstaller creates a new installer
func (*Installer) DownloadWithRetry ¶
func (i *Installer) DownloadWithRetry(url, expectedSHA256, filename string, retryConfig RetryConfig) (string, error)
DownloadWithRetry downloads a file with retry logic and optional resume
type RetryConfig ¶
type RetryConfig struct {
MaxRetries int // Maximum number of retry attempts
InitialDelay time.Duration // Initial delay before first retry
MaxDelay time.Duration // Maximum delay between retries
Timeout time.Duration // Overall timeout for download
EnableResume bool // Whether to use HTTP Range for resume
InteractiveRetry bool // Whether to prompt user for retry
}
RetryConfig holds configuration for download retries
func DefaultRetryConfig ¶
func DefaultRetryConfig() RetryConfig
DefaultRetryConfig returns the default retry configuration
Click to show internal directories.
Click to hide internal directories.