gozipper

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2021 License: MIT Imports: 9 Imported by: 0

README

gozipper

Golang zipper

zip a folder or a file

Adding dependency

import "github.com/seaweed843/gozipper"

Example:

init module:

$ go mod init main

main.go

package main

import "github.com/seaweed843/gozipper"
import "fmt"

func main() {
	err := gozipper.ZipPath("./srcFolder")
  //expected result: ./srcFolder.zip
  
  err = gozipper.ZipPath("./srcFile.ext")
  //expected result: ./srcFile.ext.zip
  
  err = gozipper.ZipPath("./srcFolder", "./dstFolder", "dstFileName.zip")
  //expected result: ./dstFolder/dstFileName.zip
  
  if err != nil {
	  fmt.Println(err)
  }

}

run:

$ go mod tidy
$ go run main.go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ZipPath

func ZipPath(srcPath string, dstPathOptional ...string) (errRet error)

Types

type SkipType

type SkipType int
const (
	FileToSkip SkipType = iota
	DirToSkip
)

Jump to

Keyboard shortcuts

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