Documentation
¶
Overview ¶
Package zip provides utilities for creating and extracting zip archives.
This package wraps the archive/zip standard library to provide convenient functions for working with zip compressed files.
Features:
- Compress multiple files and directories into zip
- Extract zip archives while preserving structure
- Recursive directory processing
- File mode preservation
Example usage:
err := zip.Compress("archive.zip", []string{"./docs", "./images"})
err := zip.Decompress("archive.zip", "./extracted")
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compress ¶
Compress compresses multiple files and directories into zip format.
Parameters:
- name: output zip file path (e.g., "test.zip")
- paths: slice of file/directory paths to compress
The function recursively processes directories and preserves file modes.
Example:
err := zip.Compress("test.zip", []string{"./test", "./test.txt"})
func Decompress ¶
Decompress extracts a zip archive to the specified directory.
Parameters:
- name: input zip file path (e.g., "test.zip")
- outputPath: output directory path where files will be extracted
The function preserves directory structure and file modes.
Example:
err := zip.Decompress("test.zip", "./output")
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.