util

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeSHA256

func ComputeSHA256(filePath string) (string, error)

ComputeSHA256 computes the SHA256 hash of a file

func ComputeSHA256FromURL

func ComputeSHA256FromURL(ctx context.Context, url string) (string, error)

ComputeSHA256FromURL fetches content from a URL and computes its SHA256 hash

func ComputeSHA256Reader

func ComputeSHA256Reader(r io.Reader) (string, error)

ComputeSHA256Reader computes the SHA256 hash from a reader

func CreateTarGz

func CreateTarGz(outputPath string, files map[string]string) error

CreateTarGz creates a .tar.gz archive from a map of archive paths to local paths The files map is: archivePath -> localPath (e.g., "myapp/1.0.0/bin/myapp" -> "/tmp/myapp")

func ExtractArchive added in v0.5.0

func ExtractArchive(archivePath, destDir string) error

ExtractArchive extracts an archive to a destination directory, dispatching on the file extension. The supported set must stay in sync with artifact.IsArchive so discovery never accepts what extraction cannot handle.

func ExtractTarBz2 added in v0.5.0

func ExtractTarBz2(archivePath, destDir string) error

ExtractTarBz2 extracts a .tar.bz2 archive to a destination directory

func ExtractTarGz

func ExtractTarGz(archivePath, destDir string) error

ExtractTarGz extracts a .tar.gz archive to a destination directory

func ExtractZip

func ExtractZip(archivePath, destDir string) error

ExtractZip extracts a .zip archive to a destination directory. Like extractTar, writes are confined to destDir by os.Root, a later member replaces an earlier one of the same name (a link is removed, never written through), and symlink entries are created as-is, so consumers must check containment themselves (as bottle.ResolveBinary does). Devices, FIFOs and sockets are skipped.

Types

This section is empty.

Jump to

Keyboard shortcuts

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