extract

package
v0.26.3 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: MPL-2.0 Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

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