archive

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package archive provides helpers for extracting and creating archive files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTarGz added in v0.1.0

func CreateTarGz(outputPath, srcDir, rootName string, filter func(relSlash string) bool) error

CreateTarGz creates a .tar.gz archive from srcDir. Each entry is stored under rootName as the archive root (no leading slash); pass an empty string to use srcDir's relative paths as-is. The filter function receives a slash-separated path relative to srcDir and returns false to exclude that entry (and, for directories, their entire subtree).

func ExtractTarGz

func ExtractTarGz(archivePath, destDir string) error

ExtractTarGz extracts a .tar.gz archive into destDir. Path traversal entries are rejected.

func ExtractZip

func ExtractZip(src, installDir string) error

ExtractZip extracts the zip archive at src into installDir. Path traversal entries are rejected.

Types

This section is empty.

Jump to

Keyboard shortcuts

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