extract

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Extract

func Extract(origReader io.Reader, destFolder string, options ...Option) error

func UnzipFolder

func UnzipFolder(source, destination string) error

func WriteTar

func WriteTar(writer io.Writer, localPath string, compress bool) error

func WriteTarExclude added in v0.5.0

func WriteTarExclude(writer io.Writer, localPath string, compress bool, excludedPaths []string) error

Types

type Archiver

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

Archiver is responsible for compressing specific files and folders within a target directory

func NewArchiver

func NewArchiver(basePath string, writer *tar.Writer, excludedPaths []string) *Archiver

NewArchiver creates a new archiver

func (*Archiver) AddToArchive

func (a *Archiver) AddToArchive(relativePath string) error

AddToArchive adds a new path to the archive

type Option

type Option func(o *Options)

func StripLevels

func StripLevels(levels int) Option

type Options

type Options struct {
	StripLevels int

	Perm *os.FileMode
	UID  *int
	GID  *int
}

Jump to

Keyboard shortcuts

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