Documentation
¶
Index ¶
- func CanRollback(execPath string) bool
- func CompleteWindowsReplacement(_, _, _, _, _, _, _, _ string, _ int) error
- func CompleteWindowsRollback(string, string, string, int) error
- func FetchChecksum(ctx context.Context, client *http.Client, manifestURL, assetName string) (string, error)
- func GetCurrentTargetAssetName() string
- func GetTargetAssetName(goos, goarch string) string
- func JournalPath() (string, error)
- func PerformRollback(execPath string) (bool, error)
- func PerformSelfUpgrade(opts UpgradeOptions) error
- func TargetAsset(buildTarget string) (string, error)
- func VerifyExecutable(path, targetVersion string) error
- func VerifySelfTest(path string) error
- func WriteCompletion(completion Completion) error
- type Completion
- type DownloadProgress
- type ReplaceFunc
- type SelfTestFunc
- type UpgradeOptions
- type UpgradeResult
- type VerifyFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanRollback ¶
func FetchChecksum ¶
func GetCurrentTargetAssetName ¶
func GetCurrentTargetAssetName() string
func GetTargetAssetName ¶
func JournalPath ¶
func PerformRollback ¶
func PerformSelfUpgrade ¶
func PerformSelfUpgrade(opts UpgradeOptions) error
func TargetAsset ¶
func VerifyExecutable ¶
func VerifySelfTest ¶
func WriteCompletion ¶
func WriteCompletion(completion Completion) error
Types ¶
type Completion ¶
type Completion struct {
TargetVersion string `json:"targetVersion"`
Outcome string `json:"outcome"`
Verification string `json:"verification"`
Rollback string `json:"rollback"`
Recovery string `json:"recovery,omitempty"`
Failure string `json:"failure,omitempty"`
CompletedAt string `json:"completedAt"`
}
func ConsumeCompletion ¶
func ConsumeCompletion() (*Completion, error)
type DownloadProgress ¶
type ReplaceFunc ¶
type ReplaceFunc func(executable, candidate, backup, targetVersion, checksum, lockPath, lockToken string, verify VerifyFunc) (bool, error)
type SelfTestFunc ¶
type UpgradeOptions ¶
type UpgradeOptions struct {
CurrentExecutablePath string
UserHome string
TargetVersion string
DownloadURL string
ExpectedChecksum string
HTTPClient *http.Client
Verify VerifyFunc
SelfTest SelfTestFunc
Replace ReplaceFunc
Progress func(DownloadProgress)
}
type UpgradeResult ¶
type UpgradeResult struct {
ExecutablePath string `json:"executablePath"`
PayloadPath string `json:"payloadPath,omitempty"`
PreviousVersion string `json:"previousVersion,omitempty"`
BackupPath string `json:"backupPath,omitempty"`
TargetVersion string `json:"targetVersion"`
LegacyTransition bool `json:"legacyTransition,omitempty"`
Recovery string `json:"recovery,omitempty"`
Progress []DownloadProgress `json:"progress,omitempty"`
}
func Upgrade ¶
func Upgrade(opts UpgradeOptions) (UpgradeResult, error)
type VerifyFunc ¶
Click to show internal directories.
Click to hide internal directories.