Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountFiles ¶
CountFiles counts the number of regular 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
ExtractZip unpacks a ZIP archive to the destination directory. Returns the path to the extracted directory and any warnings about skipped files.