installer

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Download

func Download(url, destPath string) error

Download downloads a file from the specified URL to the destination path. Uses streaming to handle large files efficiently.

Parameters:

  • url: The HTTPS URL to download from
  • destPath: The local file path where the download should be saved

func ExtractTarGz

func ExtractTarGz(tarGzPath, destDir string) error

ExtractTarGz extracts a tar.gz archive to the specified destination directory. Sets executable permissions (0755) on extracted files. Prevents path traversal attacks by validating all extraction paths.

Parameters:

  • tarGzPath: Path to the tar.gz archive
  • destDir: Destination directory for extraction

func ExtractZip

func ExtractZip(zipPath, destDir string) error

ExtractZip extracts a ZIP archive to the specified destination directory. Sets executable permissions (0755) on extracted files. Prevents path traversal attacks by validating all extraction paths.

Parameters:

  • zipPath: Path to the ZIP archive
  • destDir: Destination directory for extraction

func VerifyChecksum

func VerifyChecksum(filePath, expectedSHA256 string) error

VerifyChecksum verifies that a file's SHA256 checksum matches the expected value. This function uses streaming to handle large files efficiently without loading them entirely into memory.

Parameters:

  • filePath: Path to the file to verify
  • expectedSHA256: Expected SHA256 checksum in hexadecimal format (case-insensitive)

Returns an error if:

  • The file doesn't exist
  • The file cannot be read
  • The checksum doesn't match

Types

This section is empty.

Jump to

Keyboard shortcuts

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