Documentation
¶
Overview ¶
Package archives provides in-memory archive reading and browsing capabilities.
It supports multiple archive formats including:
- ZIP (.zip, .jar, .whl, .nupkg)
- TAR (.tar, .tar.gz, .tgz, .tar.bz2, .tar.xz)
- GEM (.gem - Ruby gems with nested tar structure)
The package is designed to work entirely in memory without writing to disk, making it suitable for browsing cached artifacts on-demand.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileInfo ¶
type FileInfo struct {
Path string // Full path within archive
Name string // Base name
Size int64 // Uncompressed size in bytes
ModTime time.Time // Modification time
IsDir bool // Whether this is a directory
Mode uint32 // File mode/permissions
CompressedSize int64 // Compressed size (if available)
}
FileInfo represents metadata about a file in an archive.
type Reader ¶
type Reader interface {
// List returns all files in the archive.
List() ([]FileInfo, error)
// ListDir returns files in a specific directory path.
// Use "" or "/" for root directory.
ListDir(dirPath string) ([]FileInfo, error)
// Extract reads a specific file from the archive.
// Returns io.ReadCloser for the file content.
Extract(filePath string) (io.ReadCloser, error)
// Close releases resources associated with the reader.
Close() error
}
Reader provides methods to browse and extract files from archives.
Click to show internal directories.
Click to hide internal directories.