unpack

package
v0.0.0-...-4402e7d Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrCreatingWorkingDirFolder represents an error creating working directory folder
	ErrCreatingWorkingDirFolder = errors.New("error creating working directory folder")
	// ErrCopyingFilesInWorkingDir represents an error copying files in working directory
	ErrCopyingFilesInWorkingDir = errors.New("error copying files in working directory")
	// ErrRemovingWorkingDirFolder represents an error removing working directory folder
	ErrRemovingWorkingDirFolder = errors.New("error removing working directory folder")
	// ErrProjectNotProvided represents an error when the project is not provided
	ErrProjectNotProvided = errors.New("project not provided")
)
View Source
var (
	// ErrTarExtractorNotProvided is returned when the tar extractor is not provided
	ErrTarExtractorNotProvided = fmt.Errorf("Tar extractor not provided")
)
View Source
var (
	// ErrWorkingDirNotExists represents an error when the destination to fetch does not exists
	ErrWorkingDirNotExists = fmt.Errorf("working directory does not exists")
)

Functions

This section is empty.

Types

type Factory

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

Factory represents the factory for unpacking source code components

func NewFactory

func NewFactory() *Factory

NewFactory creates a new Factory for unpacking source code

func (*Factory) Get

Get gets an unpacker by name

func (*Factory) Register

func (f *Factory) Register(name string, unpacker repository.SourceCodeUnpacker)

Register registers a new unpacker

type PlainFormat

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

PlainFormat struct used to unpack local files

func NewPlainFormat

func NewPlainFormat(fs afero.Fs, logger repository.Logger) *PlainFormat

NewPlainFormat method creates a new PlainFormat struct

func (*PlainFormat) Unpack

func (p *PlainFormat) Unpack(project *entity.Project, workingDir string) error

Unpack method prepares the project into the working directory. Unpacking a plain format project does not require any action. The project is already fetched in the working directory. It just checks if the working directory exists.

type TarGzipFormat

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

TarGzipFormat struct used to unpack tar.gz files

func NewTarGzipFormat

func NewTarGzipFormat(fs afero.Fs, logger repository.Logger) *TarGzipFormat

NewTarGzipFormat method creates a new TarGzipFormat struct

func (*TarGzipFormat) Unpack

func (a *TarGzipFormat) Unpack(project *entity.Project, workingDir string) error

Unpack method prepares the project into dest folder

Jump to

Keyboard shortcuts

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