archive

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const MaxFileSize = 100 * 1024 * 1024 // 100MB per file limit
View Source
const MaxTextFileSize = 1 * 1024 * 1024 // 1MB limit for text files

Variables

View Source
var TargetPatterns = map[string][]string{
	"npm":      {"package/package.json"},
	"pypi":     {"**/setup.py"},
	"rubygems": {"**/extconf.rb"},
}

Functions

func CreateTarGz

func CreateTarGz(sourceDir, destPath string) error

CreateTarGz creates a gzip-compressed tar archive from sourceDir at destPath. Symlinks and non-regular files are skipped for consistency with ExtractTarGz. Entry names are relative to sourceDir.

func DetectFormat

func DetectFormat(filename string) string

func ExtractRegularFile

func ExtractRegularFile(reader io.Reader, header *tar.Header, targetPath string) error

func ExtractTarEntry

func ExtractTarEntry(tarReader io.Reader, header *tar.Header, targetPath string) error

func ExtractTarGz

func ExtractTarGz(tarballPath, destDir string) error

func ExtractTargetFilesFromGemReader

func ExtractTargetFilesFromGemReader(r io.Reader, patterns []string) (map[string]string, error)

func ExtractTargetFilesFromReader

func ExtractTargetFilesFromReader(r io.Reader, filename string, patterns []string) (map[string]string, error)

func ExtractTargetFilesFromTarGzReader

func ExtractTargetFilesFromTarGzReader(r io.Reader, patterns []string) (map[string]string, error)

func ExtractTargetFilesFromZipReader

func ExtractTargetFilesFromZipReader(r io.Reader, patterns []string) (map[string]string, error)

func ExtractZipFile

func ExtractZipFile(f *zip.File, targetPath string) error

func SanitizeTarPath

func SanitizeTarPath(entryName, destDir string) (string, error)

func SanitizeZipPath

func SanitizeZipPath(entryName, destDir string) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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