Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrAlreadyUpToDate = errors.New("already up to date")
var ErrNeedsElevation = errors.New("update requires elevation")
ErrNeedsElevation indicates the target directory requires elevated privileges. On Windows the caller should relaunch the helper with UAC.
Functions ¶
func FormatOtherInstalls ¶ added in v1.3.72
func FormatOtherInstalls(installs []OtherInstall) string
FormatOtherInstalls returns a human-readable summary of other installs found.
func PackageManagerHint ¶ added in v1.3.72
PackageManagerHint returns the package manager that likely installed the binary at execPath, or empty string if unknown.
Types ¶
type CheckResult ¶
type DualScopeInstall ¶ added in v1.3.72
type DualScopeInstall struct {
UserPath string // perUser MSI install path (LocalAppData)
MachinePath string // perMachine MSI install path (Program Files)
}
DualScopeInstall represents a Windows-specific conflict where both perUser and perMachine ggcode installations exist simultaneously.
func DetectDualScopeWindows ¶ added in v1.3.72
func DetectDualScopeWindows() *DualScopeInstall
DetectDualScopeWindows checks if both perUser and perMachine ggcode installations exist on Windows. Returns the conflict info or nil.
type HelperManifest ¶
type HelperManifest struct {
ParentPID int `json:"parent_pid"`
SourceBinary string `json:"source_binary"`
TargetPaths []string `json:"target_paths"`
RestartPath string `json:"restart_path"`
RestartArgs []string `json:"restart_args"`
WorkingDir string `json:"working_dir"`
ExpectedVersion string `json:"expected_version"`
}
type OtherInstall ¶ added in v1.3.72
type OtherInstall struct {
Path string // absolute path to the binary
Version string // version string if known, empty otherwise
Source string // "brew", "scoop", "winget", "winget-user", "winget-machine", "npm", "pip", "go", "system", "snap", "path"
Privileged bool // true if installed in a system-wide location requiring admin/root
}
OtherInstall represents a ggcode binary found at a different location.
func FindOtherInstalls ¶ added in v1.3.72
func FindOtherInstalls(currentPath string) []OtherInstall
FindOtherInstalls scans known installation paths for ggcode binaries other than the one at currentPath. Returns a list of all found installs.
type PreparedUpdate ¶
type Service ¶
type Service struct {
CurrentVersion string
ExecPath string
ConfigPath string
WorkDir string
WrapperKind string
CheckTTL time.Duration
HTTPClient *http.Client
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) LaunchHelper ¶
func (s *Service) LaunchHelper(prepared PreparedUpdate) error