Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Download ¶
Download downloads a file from the specified URL to the destination path. Uses streaming to handle large files efficiently.
Parameters:
- url: The HTTPS URL to download from
- destPath: The local file path where the download should be saved
func ExtractTarGz ¶
ExtractTarGz extracts a tar.gz archive to the specified destination directory. Sets executable permissions (0755) on extracted files. Prevents path traversal attacks by validating all extraction paths.
Parameters:
- tarGzPath: Path to the tar.gz archive
- destDir: Destination directory for extraction
func ExtractZip ¶
ExtractZip extracts a ZIP archive to the specified destination directory. Sets executable permissions (0755) on extracted files. Prevents path traversal attacks by validating all extraction paths.
Parameters:
- zipPath: Path to the ZIP archive
- destDir: Destination directory for extraction
func VerifyChecksum ¶
VerifyChecksum verifies that a file's SHA256 checksum matches the expected value. This function uses streaming to handle large files efficiently without loading them entirely into memory.
Parameters:
- filePath: Path to the file to verify
- expectedSHA256: Expected SHA256 checksum in hexadecimal format (case-insensitive)
Returns an error if:
- The file doesn't exist
- The file cannot be read
- The checksum doesn't match
Types ¶
This section is empty.