archive

package
v0.0.0-...-17c0c07 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2015 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

archive features for goxc. Limited support for zip, tar.gz and ar archiving

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArchiveBinariesAndResources

func ArchiveBinariesAndResources(outDir, platName string, binPaths []string, appName string, resources []string, settings config.Settings, archiver Archiver, ending string, includeTopLevelDir bool) (zipFilename string, err error)

goxc function to archive a binary along with supporting files (e.g. README or LICENCE).

func TarGz

func TarGz(archiveFilename string, itemsToArchive []ArchiveItem) error

TarGz implementation of Archiver.

func TarGzWrite

func TarGzWrite(item ArchiveItem, tw *tar.Writer, fi os.FileInfo) (err error)

Write a single file to TarGz

func Zip

func Zip(zipFilename string, itemsToArchive []ArchiveItem) error

TODO: folder support

Types

type ArchiveItem

type ArchiveItem struct {
	//if FileSystemPath is empty, use Data instead
	FileSystemPath string
	ArchivePath    string
	Data           []byte
}

type definition representing a file to be archived. Details location on filesystem and destination filename inside archive.

func ArchiveItemFromBytes

func ArchiveItemFromBytes(data []byte, archivePath string) ArchiveItem

func ArchiveItemFromFileSystem

func ArchiveItemFromFileSystem(fileSystemPath, archivePath string) ArchiveItem

type Archiver

type Archiver func(archiveFilename string, itemsToArchive []ArchiveItem) error

type definition for different archiving implementations

Jump to

Keyboard shortcuts

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