ziputils

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Archive

func Archive(inFilePath string, writer io.Writer, metadataFilter *types.Metadata) error

Archive compresses a file/directory to a writer

If the path ends with a separator, then the contents of the folder at that path are at the root level of the archive, otherwise, the root of the archive contains the folder as its only item (with contents inside).

If progress is not nil, it is called for each file added to the archive.

func ArchivePartial

func ArchivePartial(inFilePath string, writer io.Writer, basePrefix string) error

ArchivePartial compresses all files in a file/directory matching a relative prefix to a writer

If the path ends with a separator, then the contents of the folder at that path are at the root level of the archive, otherwise, the root of the archive contains the folder as its only item (with contents inside).

If progress is not nil, it is called for each file added to the archive.

func CreateTestZip

func CreateTestZip(files []TestFile) (io.ReadCloser, error)

CreateTestZip allows for creating temporary in memory zip files

Types

type TestFile

type TestFile struct {
	Name string
	Body string
}

TestFile contains the information needed to create a test file

Jump to

Keyboard shortcuts

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