manifest

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountFiles

func CountFiles(dir string) (int, error)

CountFiles counts the number of regular files in a directory.

func DirSize

func DirSize(dir string) (int64, error)

DirSize calculates the total size of all files in a directory.

Types

type ArchiveResult

type ArchiveResult struct {
	// Warnings contains messages about files that were skipped (symlinks, etc.)
	Warnings []string
}

ArchiveResult contains the result of an archive operation.

func ArchiveTarGz added in v0.0.15

func ArchiveTarGz(w io.Writer, sourceDir string) (*ArchiveResult, error)

ArchiveTarGz creates a tar.gz archive of the given directory. The archive preserves the directory structure relative to the source. Returns warnings about any skipped files (symlinks, special files, etc.)

func ArchiveZip added in v0.0.15

func ArchiveZip(w io.Writer, sourceDir string) (*ArchiveResult, error)

ArchiveZip creates a ZIP archive of the given directory. The archive preserves the directory structure relative to the source. Returns warnings about any skipped files (symlinks, special files, etc.)

type ExtractResult

type ExtractResult struct {
	// Path is the path to the extracted directory (root folder from archive)
	Path string
	// Warnings contains messages about files that were skipped (symlinks, etc.)
	Warnings []string
}

ExtractResult contains the result of an extract operation.

func ExtractAuto added in v0.0.15

func ExtractAuto(r io.ReadSeeker, destDir string) (*ExtractResult, error)

ExtractAuto detects the archive format (ZIP or tar.gz) and extracts accordingly. It reads the first bytes to determine the format, then delegates to the appropriate extractor.

func ExtractTarGz added in v0.0.15

func ExtractTarGz(r io.Reader, destDir string) (*ExtractResult, error)

ExtractTarGz unpacks a tar.gz archive to the destination directory. Returns the path to the extracted directory and any warnings about skipped files.

func ExtractZip added in v0.0.15

func ExtractZip(r io.ReaderAt, size int64, destDir string) (*ExtractResult, error)

ExtractZip unpacks a ZIP archive to the destination directory. Returns the path to the extracted directory and any warnings about skipped files.

Jump to

Keyboard shortcuts

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