checksums

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeHash

func ComputeHash(filepath string, algorithm string) (string, error)

ComputeHash computes the hash of a file using the specified algorithm

Types

type EmbedMode

type EmbedMode string

EmbedMode represents the checksum acquisition mode

const (
	// EmbedModeDownload downloads checksum files from GitHub releases
	EmbedModeDownload EmbedMode = "download"
	// EmbedModeChecksumFile uses a local checksum file
	EmbedModeChecksumFile EmbedMode = "checksum-file"
	// EmbedModeCalculate downloads assets and calculates checksums
	EmbedModeCalculate EmbedMode = "calculate"
)

type Embedder

type Embedder struct {
	Mode         EmbedMode
	Version      string
	Spec         *spec.InstallSpec
	SpecAST      *ast.File
	ChecksumFile string
}

Embedder manages the process of embedding checksums

func (*Embedder) Embed

func (e *Embedder) Embed() error

Embed performs the checksum embedding process and returns the updated spec

type GitHubReleaseAsset added in v0.3.1

type GitHubReleaseAsset struct {
	Name               string `json:"name"`
	BrowserDownloadURL string `json:"browser_download_url"`
	// GitHub API sometimes includes digest information
	Digest string `json:"digest,omitempty"`
}

GitHubReleaseAsset represents a GitHub release asset

type GitHubReleaseResponse added in v0.3.1

type GitHubReleaseResponse struct {
	TagName string               `json:"tag_name"`
	Assets  []GitHubReleaseAsset `json:"assets"`
}

GitHubReleaseResponse represents a GitHub release API response

Jump to

Keyboard shortcuts

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