tar

package
v0.16.5 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GzipTarFolder

func GzipTarFolder(sourceFolder, dstFile string) error

func Tar

func Tar(source Walker, dst io.Writer) error

func TarFolder

func TarFolder(sourceFolder, dstFile string) error

func UnGzipTarFile

func UnGzipTarFile(tarFile, dstFolder string) error

func Untar

func Untar(source io.Reader, router Router) error

func UntarFile

func UntarFile(tarFile, dstFolder string) error

Types

type FolderRouter

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

func NewFolderRouter

func NewFolderRouter(folder string) FolderRouter

func (FolderRouter) ExtractPath

func (f FolderRouter) ExtractPath(header *tar.Header) string

type FolderWalker

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

func NewFolderWalker

func NewFolderWalker(folder string) FolderWalker

func (FolderWalker) Walk

func (f FolderWalker) Walk(fn TarFunc) error

type GzipPackager

type GzipPackager struct{}

func NewGzipPackager

func NewGzipPackager() GzipPackager

func (GzipPackager) Package

func (GzipPackager) Package(sourceFolder, dstFile string) error

func (GzipPackager) UnPackage

func (GzipPackager) UnPackage(orgFile, dstFolder string) error

type Packager

type Packager struct{}

func NewPackager

func NewPackager() Packager

func (Packager) Package

func (Packager) Package(sourceFolder, dstFile string) error

func (Packager) UnPackage

func (Packager) UnPackage(orgFile, dstFolder string) error

type Router

type Router interface {
	// ExtractPath instructs the path where a file should be extracted.
	// Empty strings instructs to omit the file extraction
	ExtractPath(header *tar.Header) string
}

Router instructs where to extract a file.

type TarFunc

type TarFunc func(file string, info os.FileInfo, header *tar.Header) error

type Walker

type Walker interface {
	Walk(TarFunc) error
}

Jump to

Keyboard shortcuts

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