unpackit

package
v0.0.0-...-f242dd8 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package unpackit allows you to easily unpack *.tar.gz, *.tar.bzip2, *.tar.xz, *.zip and *.tar files. There are not CGO involved nor hard dependencies of any type.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Unpack

func Unpack(reader io.Reader, destPath string, unTarName string, unTarGzSize int) (string, error)

Unpack unpacks a compressed stream. Magic numbers are used to determine what decompressor and/or unarchiver to use. when unpack not .gz files, unTarName set "", unTarGzSize set 4096 when pack .gz files, unTarName set user-defined value, unTarGzSize set user-defined size Notice:Concurrent Environment!!! should notice your files' name! Each gorountine should has a unique name!

func Untar

func Untar(data io.Reader, destPath string) (string, error)

Untar unarchives a TAR archive and returns the final destination path or an error

func Unzip

func Unzip(r io.Reader, destPath string) (string, error)

Unzip unpacks a ZIP stream. When given a os.File reader it will get its size without reading the entire zip file in memory.

Types

This section is empty.

Jump to

Keyboard shortcuts

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