unarchive

package
v2.5.0-2 Latest Latest
Warning

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

Go to latest
Published: May 6, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const FormatDMG string = "dmg"

Variables

This section is empty.

Functions

func IsUnarchived

func IsUnarchived(archiveType, assetName string) bool

Types

type Decompressor

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

func (*Decompressor) Unarchive

func (decompressor *Decompressor) Unarchive(ctx context.Context, logE *logrus.Entry, fs afero.Fs, body io.Reader, prgOpts *ProgressBarOpts) error

type Executor

type Executor interface {
	HdiutilAttach(ctx context.Context, dmgPath, mountPoint string) (int, error)
	HdiutilDetach(ctx context.Context, mountPath string) (int, error)
}

type File

type File struct {
	Body     io.Reader
	Filename string
	Type     string
}

type MockUnarchiver

type MockUnarchiver struct {
	Err error
}

func (*MockUnarchiver) Unarchive

func (unarchiver *MockUnarchiver) Unarchive(ctx context.Context, logE *logrus.Entry, src *File, dest string, fs afero.Fs, prgOpts *ProgressBarOpts) error

type ProgressBarOpts

type ProgressBarOpts struct {
	ContentLength int64
	Description   string
}

type Unarchiver

type Unarchiver interface {
	Unarchive(ctx context.Context, logE *logrus.Entry, src *File, dest string, fs afero.Fs, prgOpts *ProgressBarOpts) error
}

type UnarchiverImpl

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

func New

func New(executor Executor) *UnarchiverImpl

func (*UnarchiverImpl) Unarchive

func (unarchiver *UnarchiverImpl) Unarchive(ctx context.Context, logE *logrus.Entry, src *File, dest string, fs afero.Fs, prgOpts *ProgressBarOpts) error

Jump to

Keyboard shortcuts

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