archive

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: 18 Imported by: 0

Documentation

Overview

Package archive verifies and installs platform release archives.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractBinaryBytes added in v0.6.1

func ExtractBinaryBytes(archive []byte, archiveName, binaryName string) ([]byte, error)

ExtractBinaryBytes 从发布归档中提取唯一预期二进制并返回其字节。 归档内存在重复、非普通文件或缺失该二进制都会显式报错。

Types

type Release

type Release = model.Release

Release 与 ReleaseAsset 保持 archive 包内部使用同一 wire model。

type ReleaseAsset

type ReleaseAsset = model.ReleaseAsset

type ReleaseInstaller

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

ReleaseInstaller installs an already verified release for the current platform.

func NewReleaseInstaller

func NewReleaseInstaller(options ReleaseInstallerOptions) ReleaseInstaller

NewReleaseInstaller creates the production archive updater. Every write is delayed until the signed release manifest, its Ed25519 signatures, the archive SHA-256 and the extracted binary SHA-256 all match.

type ReleaseInstallerOptions

type ReleaseInstallerOptions struct {
	HTTPClient        *http.Client
	ExecutablePath    func() (string, error)
	GOOS              string
	GOARCH            string
	Keyring           *manifest.Keyring
	Replacer          func(string, string) error
	AssetURLValidator func(model.Release, model.ReleaseAsset) error
}

ReleaseInstallerOptions injects system boundaries for deterministic tests.

Jump to

Keyboard shortcuts

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