archive

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2020 License: MIT Imports: 6 Imported by: 1

Documentation

Overview

Package archive provides helper tasks related to archives.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateZipArchive

type CreateZipArchive struct {
	// SourceDir sets the source dir to compress. Required.
	SourceDir string

	// BasePath sets the base path for the archive files. Defaults to no base path.
	BasePath string

	// FilterFile provides an optional callback to filter a file.
	FilterFile FileFilterFunc
}

CreateZipArchive creates a zip archive from a path.

func (*CreateZipArchive) CompressTo

func (c *CreateZipArchive) CompressTo(dest io.Writer) error

CompressTo compresses to a writer.

type FileFilterFunc

type FileFilterFunc func(path string, info os.FileInfo) bool

FileFilterFunc is the type of the function called for each file visited by archiver. The path argument contains the source dir argument to compress. Returns value indicates the archiver to compress the file or not.

Jump to

Keyboard shortcuts

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