zip

package
v0.0.0-...-b8c1802 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2025 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstructPath

func ConstructPath(preffix, directory, fileName string) (s string)

func FilesEqual

func FilesEqual(a, b files.File) bool

func ZipFolder

func ZipFolder(path, output string)

func ZipFolderN

func ZipFolderN(folderPath, outputName string)

Types

type Crawler

type Crawler interface {
	HandleFile(filename os.DirEntry)
	HandleFolder(path os.DirEntry)
	Crawl(path string)
}

type ZipCrawler

type ZipCrawler struct {
	ZipFile
	// contains filtered or unexported fields
}

func (*ZipCrawler) Crawl

func (c *ZipCrawler) Crawl(path string)

func (*ZipCrawler) HandleFile

func (c *ZipCrawler) HandleFile(path string)

To handle files, we simply write the file contents to the zip file in the location specified by the path.

func (*ZipCrawler) HandleFolder

func (c *ZipCrawler) HandleFolder(path string)

To handle folders we simply recursively call Crawl on the folder being zipped.

type ZipFile

type ZipFile struct {
	// contains filtered or unexported fields
}

~~~~~~~~~~~~~~~~~~~~ ZipFile

func EmptyZip

func EmptyZip() *ZipFile

func NewZipFile

func NewZipFile(name string) *ZipFile

func (*ZipFile) AddZipFile

func (z *ZipFile) AddZipFile(filename string, contents io.Reader)

func (*ZipFile) GetName

func (z *ZipFile) GetName() string

func (*ZipFile) WriteAndClose

func (z *ZipFile) WriteAndClose()

Jump to

Keyboard shortcuts

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