Documentation
¶
Index ¶
- func ComputeSHA256(filePath string) (string, error)
- func ComputeSHA256FromURL(ctx context.Context, url string) (string, error)
- func ComputeSHA256Reader(r io.Reader) (string, error)
- func CreateTarGz(outputPath string, files map[string]string) error
- func ExtractArchive(archivePath, destDir string) error
- func ExtractTarBz2(archivePath, destDir string) error
- func ExtractTarGz(archivePath, destDir string) error
- func ExtractZip(archivePath, destDir string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeSHA256 ¶
ComputeSHA256 computes the SHA256 hash of a file
func ComputeSHA256FromURL ¶
ComputeSHA256FromURL fetches content from a URL and computes its SHA256 hash
func ComputeSHA256Reader ¶
ComputeSHA256Reader computes the SHA256 hash from a reader
func CreateTarGz ¶
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
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
ExtractTarBz2 extracts a .tar.bz2 archive to a destination directory
func ExtractTarGz ¶
ExtractTarGz extracts a .tar.gz archive to a destination directory
func ExtractZip ¶
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.