zipdata

command module
v0.0.0-...-4a352b0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2020 License: MIT Imports: 9 Imported by: 0

README

zipdata

  • Generate go code from directory(zip it recursively) or zip file.
  • The generated code does not need this library.
  • The generated code can automatically unzip the zipdata to the given folder.

Installation

To install the command line program, use the following:

go get -u github.com/alitrack/zipdata

Usage

# zip directory named static  and generate code named static.go
$ zipdata -s static -g static.go -d .

# or zip static.zip file  and generate code named static.go
$ zipdata -s static.zip -g static.go -d .

Sample generated code

package main
import (
 "archive/zip"
 "bytes"
 "fmt"
 "io"
 "os"
 "path/filepath"
)

func init() {
 err := UnzipBytes(zipdata, destDir)

 if err != nil {
  fmt.Println(err)
  return
 }
}

func main(){
 fmt.Println(destDir)
}
var destDir="."


var zipdata =[]byte{
  0x50, 0x4b, 0x03, 0x04, 0x14, 0x00, 0x00, 0x00, 0x08, 0x00, 0xdb, 0x82,
  0x0f, 0x51, 0x7d, 0xfd, 0xd6, 0x5c, 0x02, 0x06, 0x00, 0x00, 0x03, 0x10,
  0x00, 0x00, 0x0a, 0x00, 0x1c, 0x00, 0x7a, 0x69, 0x70, 0x64, 0x61, 0x74,
  0x61, 0x2e, 0x67, 0x6f, 0x55, 0x54, 0x09, 0x00, 0x03, 0x5d, 0x9b, 0x37,
  0x5f, 0x8f, 0x9b, 0x37, 0x5f, 0x75, 0x78, 0x0b, 0x00, 0x01, 0x04, 0xf5,
  0x01, 0x00, 0x00, 0x04, 0x14, 0x00, 0x00, 0x00, 0xa5, 0x57, 0x6d, 0x73,
  0xd3, 0x46, 0x10, 0xfe, 0x2c, 0xfd, 0x8a, 0xad, 0x3a, 0x69, 0xa4, 0x60,
  0xe4, 0xc0, 0xc7, 0x30, 0xfe, 0x00, 0x21, 0xa1, 0xe9, 0x40, 0xc2, 0x04,
  0x28, 0xd3, 0x02, 0x83, 0x2f, 0xf6, 0xc9, 0xbe, 0x89, 0x7c, 0xa7, 0x39,
  0x9d, 0x62, 0x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 0x44, 0x9e,
  0xaf, 0x06, 0xb4, 0x39, 0xf1, 0x7b, 0x3e, 0x6b, 0x84, 0xff, 0x66, 0xd7,
  0xa0, 0x04, 0x96, 0xfe, 0x0c, 0x33, 0xb6, 0xb4, 0x46, 0xcf, 0x08, 0xc2,
  0xde, 0xd7, 0x40, 0x2b, 0xb7, 0x35, 0x60, 0xec, 0x74, 0x85, 0xc7, 0x44,
  0x4c, 0x61, 0x96, 0xf2, 0x65, 0x97, 0xf4, 0x08, 0xe5, 0x5f, 0x50, 0x4b,
  0x01, 0x02, 0x1e, 0x03, 0x14, 0x00, 0x00, 0x00, 0x08, 0x00, 0xdb, 0x82,
  0x0f, 0x51, 0x7d, 0xfd, 0xd6, 0x5c, 0x02, 0x06, 0x00, 0x00, 0x03, 0x10,
  0x00, 0x00, 0x0a, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
  0x00, 0x00, 0xa4, 0x81, 0x00, 0x00, 0x00, 0x00, 0x7a, 0x69, 0x70, 0x64,
  0x61, 0x74, 0x61, 0x2e, 0x67, 0x6f, 0x55, 0x54, 0x05, 0x00, 0x03, 0x5d,
  0x9b, 0x37, 0x5f, 0x75, 0x78, 0x0b, 0x00, 0x01, 0x04, 0xf5, 0x01, 0x00,
  0x00, 0x04, 0x14, 0x00, 0x00, 0x00, 0x50, 0x4b, 0x05, 0x06, 0x00, 0x00,
  0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x50, 0x00, 0x00, 0x00, 0x46, 0x06,
  0x00, 0x00, 0x00, 0x00,}


func unzip(zipReader *zip.Reader, destDir string) error {
 for _, f := range zipReader.File {
  fpath := filepath.Join(destDir, f.Name)
  if f.FileInfo().IsDir() {
   os.MkdirAll(fpath, os.ModePerm)
  } else {
   if err := os.MkdirAll(filepath.Dir(fpath), os.ModePerm); err != nil {
    return err
   }

   inFile, err := f.Open()
   if err != nil {
    return err
   }
   defer inFile.Close()

   outFile, err := os.OpenFile(fpath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, f.Mode())
   if err != nil {
    return err
   }
   defer outFile.Close()

   _, err = io.Copy(outFile, inFile)
   if err != nil {
    return err
   }
  }
 }

 return nil
}

//UnzipBytes unzip from byte[] data
func UnzipBytes(data []byte, destDir string) error {

 r := bytes.NewReader(data)

 zipReader, err := zip.NewReader(r, r.Size())

 if err != nil {
  return err
 }

 return unzip(zipReader, destDir)
}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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