compress

package
v1.5.4 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

README

compress

form: https://github.com/artdarek/go-unzip

Wrapper for Zip and 7zip decompression.

Example

package main

import (
	"fmt"

	"github.com/ulib/fsutil/compress"
)

func main() {
	u := compress.NewSevenZip()

	files, err := u.Extract("./data/file.7z", "./data/directory")
	if err != nil {
		panic(err)
	}

	fmt.Printf("extracted files count: %d \n", len(files))
	fmt.Printf("files list: %v \n", files)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New7Zip added in v0.1.0

func New7Zip(pwd ...string) *sevenZip

Types

type Zip

type Zip struct{}

func NewZip

func NewZip() *Zip

func (Zip) Create added in v0.1.0

func (z Zip) Create(source string, files []string) error

Example:

package main

import (
	"fmt"

	"github.com/3JoB/ulib/fsutil/compress"
	"github.com/3JoB/ulib/fsutil"
)

func main() {
	//Todo:
}

func (Zip) Extract

func (z Zip) Extract(source, destination string) ([]string, error)

Jump to

Keyboard shortcuts

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