archive

package
v0.0.0-...-bc187e0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

View Source
const ExtractActivityName = "extract-archive-activity"

Variables

View Source
var (
	ErrNotAFile       = errors.New("Not a file")
	ErrInvalidArchive = errors.New("Invalid archive")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	DirMode  fs.FileMode
	FileMode fs.FileMode
}

type ExtractActivity

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

func NewExtractActivity

func NewExtractActivity(cfg Config) *ExtractActivity

func (*ExtractActivity) Execute

Execute extracts the content of SourcePath to a unique extract directory in DestPath then returns the ExtractPath.

If SourcePath is a directory an ErrNotAFile error is returned. If SourcePath is a file, but not a valid archive, an ErrInvalidArchive error is returned.

type ExtractActivityParams

type ExtractActivityParams struct {
	// SourcePath is the path of the archive to be extracted.
	SourcePath string

	// DestPath is the path where the ExtractPath should be created. If
	// DestPath is not set then ExtractPath will be in the same directory as
	// SourcePath.
	DestPath string
}

type ExtractActivityResult

type ExtractActivityResult struct {
	// ExtractPath is the path of the extracted archive contents.
	ExtractPath string
}

Jump to

Keyboard shortcuts

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