extract

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 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 IsRecursiveSymlink(f os.FileInfo, symlinkPath string) bool

IsRecursiveSymlink checks if the provided non-resolved file info is a recursive symlink

func UnzipFolder

func UnzipFolder(source, destination string) error

func WriteTar

func WriteTar(writer io.Writer, localPath string, compress bool) 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) *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 FileInformation

type FileInformation struct {
	Name           string
	Size           int64
	Mtime          int64
	MtimeNano      int64
	Mode           os.FileMode
	IsDirectory    bool
	IsSymbolicLink bool
	ResolvedLink   bool
	Files          int
}

FileInformation describes a path or file that is synced either in the remote container or locally

type Option

type Option func(o *Options)

func OverridePerm

func OverridePerm(perm os.FileMode) Option

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