archive

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package archive provides zip/unzip utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Unzip

func Unzip(archivePath, outputDir string, opts UnzipOptions) ([]string, error)

Unzip extracts a zip archive.

func Zip

func Zip(outputPath string, paths []string, opts ZipOptions) error

Zip creates a zip archive from files/directories.

Types

type ListEntry

type ListEntry struct {
	Name       string `json:"name"`
	Size       int64  `json:"size"`
	Compressed int64  `json:"compressed"`
	IsDir      bool   `json:"is_dir"`
	Modified   string `json:"modified"`
}

ListEntry represents an entry in an archive.

func List

func List(archivePath string) ([]ListEntry, error)

List returns the contents of a zip archive.

type UnzipOptions

type UnzipOptions struct {
	Overwrite bool // Overwrite existing files
}

UnzipOptions configures extraction.

type ZipOptions

type ZipOptions struct {
	CompressionLevel int // 0-9, -1 for default
}

ZipOptions configures zip creation.

func DefaultZipOptions

func DefaultZipOptions() ZipOptions

DefaultZipOptions returns sensible defaults.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL