compress

package
v0.6.16 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: Apache-2.0 Imports: 9 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GUnzippedBytes

func GUnzippedBytes(input []byte) ([]byte, error)

GUnzippedBytes uncompresses a slice of bytes.

func GZippedBytes

func GZippedBytes(input []byte) ([]byte, error)

GZippedBytes compresses a slice of bytes.

func UnzipArchiveToMap

func UnzipArchiveToMap(b []byte) (map[string][]byte, error)

UnzipArchiveToMap will decompress a zip archive to a map. May be memory intensive for large zip archives.

func UnzipArchiveToPath

func UnzipArchiveToPath(b []byte, dest string) ([]string, error)

UnzipArchiveToPath will decompress a zip archive, writing all files and folders within the zip archive (parameter 1) to an output directory (parameter 2). Based on an example published at https://golangcode.com/unzip-files-in-go/

func ZipArchiveOfFiles

func ZipArchiveOfFiles(files []string, prefix string) (buf bytes.Buffer, err error)

ZipArchiveOfFiles stores a list of files in a zip archive. The specified prefix is stripped from file names in the archive.

func ZipArchiveOfPath

func ZipArchiveOfPath(path, prefix string, recursive bool) (buf bytes.Buffer, err error)

ZipArchiveOfPath reads the contents of a path into a zip archive. The specified prefix is stripped from file names in the archive. Based on an example published at https://golangcode.com/create-zip-files-in-go/

Types

This section is empty.

Jump to

Keyboard shortcuts

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