zip

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2020 License: MIT Imports: 8 Imported by: 6

Documentation

Overview

Package zip exposes convenience functions to work with ZIP archives

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddToZip

func AddToZip(zipWriter *zip.Writer, source string, rootSource string, logger *logrus.Logger) error

AddToZip creates a source object (either a file, or a directory that will be recursively added) to a previously opened zip.Writer. The archive path of `source` is relative to the `rootSource` parameter.

func AnnotateAddToZip added in v1.3.0

func AnnotateAddToZip(zipWriter *zip.Writer,
	source string,
	rootSource string,
	annotator FileHeaderAnnotator,
	logger *logrus.Logger) error

AnnotateAddToZip is an extended Zip writer that accepts an annotation function to customize the FileHeader values written into the archive

Types

type FileHeaderAnnotator added in v1.3.0

type FileHeaderAnnotator func(header *zip.FileHeader) (*zip.FileHeader, error)

FileHeaderAnnotator represents a callback function that accepts the current file being added to allow it to customize the ZIP archive values

Jump to

Keyboard shortcuts

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