zip_files v1

A simple Go library for creating and extracting ZIP archives in memory. Create ZIP files by adding bytes, or extract files from existing ZIP archives into a map of bytes.

Repository

Installation

Usage

Creating ZIP Archives

Extracting ZIP Archives

API Reference

New() *Zipper

Creates a new Zipper instance for creating ZIP archives.

AddFile(filename string, file []byte)

Adds a file to the ZIP archive with the specified filename and content.

CountFiles() int

Returns the number of files currently added to the archive.

Files() []string

Returns a slice of filenames currently added to the archive.

Zip() ([]byte, error)

Creates and returns the ZIP archive as a byte slice.

Last updated