update

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandRunner

type CommandRunner interface {
	Run(context.Context, string, ...string) error
}

CommandRunner executes package-manager commands without shell interpolation.

type Coordinator

type Coordinator struct {
	// contains filtered or unexported fields
}

Coordinator chooses a safe update strategy for the detected installation source.

func NewCoordinator

func NewCoordinator(options CoordinatorOptions) (*Coordinator, error)

NewCoordinator validates the dependencies shared by command and tests.

func (*Coordinator) Execute

func (c *Coordinator) Execute(ctx context.Context, request model.Request) (model.Result, error)

Execute checks for a newer release and, unless --check was requested, installs it.

type CoordinatorOptions

type CoordinatorOptions struct {
	SourceDetector   SourceDetector
	ReleaseChecker   ReleaseChecker
	CommandRunner    CommandRunner
	ReleaseInstaller ReleaseInstaller
}

CoordinatorOptions provides external dependencies for a testable update flow.

type ReleaseChecker

type ReleaseChecker interface {
	Check(context.Context, bool) (*model.Release, error)
}

ReleaseChecker resolves the highest compatible published GitHub Release.

type ReleaseInstaller

type ReleaseInstaller interface {
	Install(context.Context, model.Release) error
}

ReleaseInstaller installs an already verified release for the current platform.

type SourceDetector

type SourceDetector interface {
	Detect(buildinfo.Info) (model.InstallSource, error)
}

SourceDetector determines which installer owns the currently running binary.

type SourceDetectorFunc

type SourceDetectorFunc func(buildinfo.Info) (model.InstallSource, error)

SourceDetectorFunc adapts a function for coordinator tests and composition.

func (SourceDetectorFunc) Detect

Detect calls the wrapped source detector.

Directories

Path Synopsis
Package archive verifies and installs platform release archives.
Package archive verifies and installs platform release archives.
Package manifest 定义 v1 签名发布清单协议:发布清单、签名文件、规范 JSON 编码、Ed25519 签名与验签,以及客户端内置的公钥环。
Package manifest 定义 v1 签名发布清单协议:发布清单、签名文件、规范 JSON 编码、Ed25519 签名与验签,以及客户端内置的公钥环。
Package model 保存更新流程跨领域共享的数据模型。
Package model 保存更新流程跨领域共享的数据模型。
Package process 管理更新流程中的命令执行、候选二进制校验和平台替换。
Package process 管理更新流程中的命令执行、候选二进制校验和平台替换。
Package release reads and compares published GitHub releases.
Package release reads and compares published GitHub releases.
Package source identifies the installation source before an update writes.
Package source identifies the installation source before an update writes.

Jump to

Keyboard shortcuts

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