process

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package process 管理更新流程中的命令执行、候选二进制校验和平台替换。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupPendingWindowsUpdate

func CleanupPendingWindowsUpdate() error

CleanupPendingWindowsUpdate has no work outside Windows.

func ExecutableName

func ExecutableName(goos string) string

ExecutableName returns the platform-specific javdb executable name.

func ReplaceExecutable

func ReplaceExecutable(sourcePath, targetPath string) error

ReplaceExecutable performs an atomic same-filesystem replacement on Unix-like hosts.

func ResolveExecutablePath

func ResolveExecutablePath(executablePath string) (string, error)

ResolveExecutablePath resolves an executable path and follows a symlink when the platform replacement must target the real binary.

Types

type BinaryChecker

type BinaryChecker interface {
	Check(context.Context, string, string) error
}

BinaryChecker validates a downloaded binary before it can replace javdb.

func NewBinaryChecker

func NewBinaryChecker() BinaryChecker

NewBinaryChecker returns the production checker for a staged javdb binary.

type BinaryCheckerFunc

type BinaryCheckerFunc func(context.Context, string, string) error

BinaryCheckerFunc adapts a function for installer tests and调用方注入。

func (BinaryCheckerFunc) Check

func (f BinaryCheckerFunc) Check(ctx context.Context, path, version string) error

Check invokes the wrapped binary checker.

type CommandRunner

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

CommandRunner executes package-manager commands without shell interpolation.

func NewCommandRunner

func NewCommandRunner(stdout, stderr io.Writer) CommandRunner

NewCommandRunner returns the production package-manager runner.

Jump to

Keyboard shortcuts

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