zipman

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: MIT Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

archive compressor/extractor | golang library

go logo

supported formats and functionality:

  • zip (compression/extraction/adding)
  • tar (compression/extraction/adding)
  • tar.gz (compression/extraction/adding)
  • 7z (compression/extraction)
  • bz2 (compression/extraction)
  • rar (extraction)

project structure:

├── 7z.go
├── bzip2.go
├── go.mod
├── go.sum
├── LICENSE
├── rar.go
├── README.md
├── tar.go
├── targz.go
└── zip.go

installation

go get github.com/kenjitheman/zipman

usage

package main

import "github.com/kenjitheman/zipman"

func main() {
	zipman.CompressToZip("./file.zip", []string{"./man.txt", "./hello.txt"})

    // zipman.AddFileToZip(zipWriter *zip.Writer, filename string)
	// zipman.ExtractZip("./file.zip", "./man")
}
➜  zipman git:(master) ✗ go run main.go
[SUCCESS] Zip compression completed successfully for file: ./file.zip

contributing

  • pull requests are welcome, for major changes, please open an issue first to discuss what you would like to change

license

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFileToTar

func AddFileToTar(tarWriter *tar.Writer, filename string) error

func AddFileToZip

func AddFileToZip(zipWriter *zip.Writer, filename string) error

func CompressTo7z

func CompressTo7z(filename string, filesToCompress []string) error

func CompressToBzip2

func CompressToBzip2(filename, compressedFilename string) error

func CompressToTar

func CompressToTar(tarFilename string, filesToCompress []string) error

func CompressToTarGz

func CompressToTarGz(tarGzFilename string, filesToCompress []string) error

func CompressToZip

func CompressToZip(filename string, filesToCompress []string)

func Extract7z

func Extract7z(filename, destFoldername string) error

func ExtractFromBzip2

func ExtractFromBzip2(compressedFilename, extractedFilename string) error

func ExtractRar

func ExtractRar(rarFilename, destFoldername string) error

func ExtractTar

func ExtractTar(tarFilename string, destFolder string) error

func ExtractTarGz

func ExtractTarGz(tarGzFilename string, destFolder string) error

func ExtractZip

func ExtractZip(zipFilename, destFoldername string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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