Documentation ¶
Index ¶
Constants ¶
const Deflate uint16 = 8
Deflate mode compresses archived files
const Store uint16 = 0
Store mode archives files but does not compress them
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
func New ¶
New eturns an instance of the Writer, the filename is used to create the resulting zip file
func (*Writer) AddFile ¶
AddFile creates a new file entry in the zip archive. source specifies an existing file to read contents from. The name is the path name of the file in the archive. Note that if name is an empty string, the filename from source will be used and the file will be created in the root path.
func (*Writer) AddFolder ¶
AddFolder creates a new folder entry int the archive and recursively adds all files within the folder. The file structure of the folder is preserved. The name property is used to name the folder path, however, if the name is empty, the folder name will be inferred from the source path and the folder will be stored in the root directory.