update

package
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const HandoffArg = "--update-handoff"

Variables

This section is empty.

Functions

func ChannelLabel

func ChannelLabel(ch Channel, detail string) string

func LaunchHandoff

func LaunchHandoff(action *HandoffAction) error

func PathHealthLabel

func PathHealthLabel(ph PathHealth) string

func RunHandoffFromFile

func RunHandoffFromFile(path string) error

Types

type ApplyMode

type ApplyMode string
const (
	ApplyModeNone       ApplyMode = "none"
	ApplyModeCommand    ApplyMode = "command"
	ApplyModeInstaller  ApplyMode = "installer"
	ApplyModeReplaceBin ApplyMode = "replace_binary"
	ApplyModeGuidance   ApplyMode = "guidance"
)

type ApplyResult

type ApplyResult struct {
	Success       bool
	Message       string
	NeedsRelaunch bool
	Handoff       *HandoffAction
	RelaunchPath  string
	RelaunchArgs  []string
}

func Apply

func Apply(ctx context.Context, check CheckResult, currentExe string) (ApplyResult, error)

type AssetInfo

type AssetInfo struct {
	Name string
	URL  string
}

type Channel

type Channel string
const (
	ChannelUnknown          Channel = "unknown"
	ChannelWindowsInstaller Channel = "windows_installer"
	ChannelMacOSBrew        Channel = "macos_brew"
	ChannelStandalone       Channel = "standalone"
	ChannelLinuxGuidance    Channel = "linux_guidance"
)

type CheckResult

type CheckResult struct {
	CheckedAt       time.Time
	ETag            string
	CurrentVersion  string
	LatestVersion   string
	LatestTag       string
	ReleaseURL      string
	UpdateAvailable bool
	Channel         Channel
	ChannelDetail   string
	PathHealth      PathHealth
	ApplyMode       ApplyMode
	ApplyCommand    []string
	Guidance        []string
	Asset           AssetInfo
	Checksums       AssetInfo
	InstallerExe    string
}

func Check

func Check(ctx context.Context, currentVersion string, cfg *config.Config) (CheckResult, error)

type HandoffAction

type HandoffAction struct {
	Type             HandoffActionType `json:"type"`
	ParentPID        int               `json:"parent_pid"`
	InstallerPath    string            `json:"installer_path,omitempty"`
	InstallerArgs    []string          `json:"installer_args,omitempty"`
	NewBinaryPath    string            `json:"new_binary_path,omitempty"`
	TargetBinaryPath string            `json:"target_binary_path,omitempty"`
	RelaunchPath     string            `json:"relaunch_path"`
	RelaunchArgs     []string          `json:"relaunch_args,omitempty"`
	CleanupDir       string            `json:"cleanup_dir,omitempty"`
}

type HandoffActionType

type HandoffActionType string
const (
	HandoffInstaller HandoffActionType = "installer"
	HandoffReplace   HandoffActionType = "replace"
)

type PathHealth

type PathHealth struct {
	Healthy      bool
	ResolvedPath string
	DesiredPath  string
	Message      string
	Conflicts    []string
}

func FixPathConflicts

func FixPathConflicts(ctx context.Context, desiredExe string) (PathHealth, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL