update

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAlreadyUpToDate = errors.New("already up to date")

Functions

func RunHelper

func RunHelper(manifestPath string) error

Types

type CheckResult

type CheckResult struct {
	CurrentVersion string    `json:"current_version"`
	LatestVersion  string    `json:"latest_version"`
	HasUpdate      bool      `json:"has_update"`
	CheckedAt      time.Time `json:"checked_at"`
}

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 PreparedUpdate

type PreparedUpdate struct {
	Version      string
	HelperPath   string
	ManifestPath string
}

type Service

type Service struct {
	CurrentVersion string
	ExecPath       string
	ConfigPath     string
	WorkDir        string
	WrapperKind    string
	CheckTTL       time.Duration
	HTTPClient     *http.Client
}

func NewService

func NewService(currentVersion, execPath, configPath, workDir string) *Service

func (*Service) Check

func (s *Service) Check(ctx context.Context) (CheckResult, error)

func (*Service) LaunchHelper

func (s *Service) LaunchHelper(prepared PreparedUpdate) error

func (*Service) Prepare

func (s *Service) Prepare(ctx context.Context, resumeID string) (PreparedUpdate, error)

Jump to

Keyboard shortcuts

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