checksums

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2025 License: MIT Imports: 21 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

Jump to

Keyboard shortcuts

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