zipper

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ZipToFile

func ZipToFile(dir, zipFile string, logFunc func(string, ...any)) error

ZipToFile is a convenience function meant to be equivalent to using the command line: 'zip -Xrj $zipFile $dir`

Types

type Zipper

type Zipper struct {
	// contains filtered or unexported fields
}

func New

func New(w io.Writer, logFunc func(string, ...any)) *Zipper

New returns a new zipper configured to zip the contents of dir.

func (*Zipper) ZipDir

func (z *Zipper) ZipDir(dir string) error

ZipDir zips the contents of dir to the provided writer, and flattens any directory hierarchy, so the resultant zip has just a flat list of files. Filename conflicts result in error. It aims to produce reproducible zips by writing entries in a predictable order.

It is intended to perform the same function as calling 'zip -Xrj $zipFile $dir'

Jump to

Keyboard shortcuts

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