zip

package module
v0.0.0-...-79016b8 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2018 License: MIT Imports: 6 Imported by: 0

README

zip

Simple zip utility with a pluggable filesystem backend.

go get github.com/jackmordaunt/zip

The filesystem defaults to afero.OsFs, which operates on the host OS native filesystem.

Example use:

func main() {
        _ = zip.Create("path/to/archive.zip", "path/to/source")
        _ = zip.Extract("path/to/achive.zip", "path/to/dest")
}

To set the filesystem backend:

func main() {
        filesystem := afero.NewMemMapFs()
        zip.SetFs(filesystem)
        
        _ = zip.Create("path/to/archive.zip", "path/to/source")
        _ = zip.Extract("path/to/achive.zip", "path/to/dest")
}

Documentation

Overview

Package zip provides an easy way to create and extract zip archives with a pluggable filesystem backend using `afero.Fs`.

Note: No compression is performed in the current implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(archive, source string) error

Create a zip archive at `archive` with the contents of `source`.

func Extract

func Extract(archive, dest string) error

Extract the contents of a zip archive into `dest`.

func SetFs

func SetFs(filesystem afero.Fs)

SetFs to the provided implementation.

Types

This section is empty.

Jump to

Keyboard shortcuts

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