archive

package
v0.0.0-...-c6e4f4a Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: MulanPSL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ZipStore   = zip.Store
	ZipDeflate = zip.Deflate
)

Variables

View Source
var DefaultZipOption = ZipOption{
	Method: ZipStore,
}

Functions

func CompressTarGzip

func CompressTarGzip(ctx context.Context, srcPath string, destPath string) error

func CompressZip

func CompressZip(ctx context.Context, srcPath string, destPath string) error

func DecompressTarGzip

func DecompressTarGzip(ctx context.Context, srcPath string, destPath string) error

func DecompressZip

func DecompressZip(ctx context.Context, srcPath string, destPath string) error

Types

type TarGzipWriter

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

func NewTarGzipWriter

func NewTarGzipWriter(path string) (*TarGzipWriter, error)

func (*TarGzipWriter) AddDir

func (p *TarGzipWriter) AddDir(ctx context.Context, name string, dir string) error

func (*TarGzipWriter) AddFile

func (p *TarGzipWriter) AddFile(ctx context.Context, name string, file string) error

func (*TarGzipWriter) AddFileByReader

func (p *TarGzipWriter) AddFileByReader(ctx context.Context, name string, fi os.FileInfo, reader io.Reader) error

func (*TarGzipWriter) Close

func (p *TarGzipWriter) Close()

type ZipOption

type ZipOption struct {
	Method uint16
}

type ZipWriter

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

func NewZipWriter

func NewZipWriter(path string, opt ZipOption) (*ZipWriter, error)

func (*ZipWriter) AddDir

func (p *ZipWriter) AddDir(ctx context.Context, name string, dir string) error

func (*ZipWriter) AddFile

func (p *ZipWriter) AddFile(ctx context.Context, name string, file string) error

func (*ZipWriter) AddFileByReader

func (p *ZipWriter) AddFileByReader(ctx context.Context, name string, fi os.FileInfo, reader io.Reader) error

func (*ZipWriter) Close

func (p *ZipWriter) Close()

Jump to

Keyboard shortcuts

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