zip

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2018 License: GPL-3.0 Imports: 6 Imported by: 0

README

Zipping files via Go the 'complete' way

This allows you to add folders (recusive) or files while still maintaining dates and more importantly file permissions, even in windows.

Usage:

zipFile, err := zip.NewZipFile("zip-file-path.zip")
if err != nil {
    return err
}

zipFile.AddFile("file") // run for each file
zipFile.AddFolder("folder") // add a folder

zipFile.Write() // Write the zip file

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ZipFile

type ZipFile struct {
	Files []string
	// contains filtered or unexported fields
}

func NewZipFile

func NewZipFile(outPath string) (*ZipFile, error)

func (*ZipFile) AddFile

func (z *ZipFile) AddFile(filePath string) error

func (*ZipFile) AddFolder

func (z *ZipFile) AddFolder(folderPath string) error

func (*ZipFile) SetOutPath

func (z *ZipFile) SetOutPath(outPath string)

func (*ZipFile) Write

func (z *ZipFile) Write() error

Jump to

Keyboard shortcuts

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