zip

package module
v0.0.0-...-e50c684 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2018 License: MIT Imports: 5 Imported by: 0

README

zip

A go package to zip stuff

Installation

go get github.com/ecnepsnai/zip

Usage

package main

import "github.com/ecnepsnai/zip"

func main() {
    Console, err := console.New(logPath, console.LevelDebug)
    if err != nil {
        panic(err.Error())
    }

    Console.Debug("Hopefully this helps")
    Console.Info("Hey, listen!")
    Console.Warn("Uh oh, what did you do?")
    Console.Error("You've ruined EVERYTHING!")
}

Documentation

Overview

Package zip utility to make working with zip archives easier

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Archive

type Archive struct {
	Filename string
	// contains filtered or unexported fields
}

Archive describes a zip archive

func New

func New() (*Archive, error)

New create a new empty zip archive in-memory

func NewZipFile

func NewZipFile(filename string) (*Archive, error)

NewZipFile create a new empty zip archive with the given file path

func (*Archive) AddFile

func (a *Archive) AddFile(name string, data []byte) error

AddFile add a new file to the archive with the given file name and data

func (*Archive) Bytes

func (a *Archive) Bytes() ([]byte, error)

Bytes for in-memory archives, return the byte data of archive

func (*Archive) Close

func (a *Archive) Close()

Close flush and save the archive

func (*Archive) InsertFile

func (a *Archive) InsertFile(path string) error

InsertFile add an existing file to the archive with the given path

func (*Archive) NewFile

func (a *Archive) NewFile(name string) (io.Writer, error)

NewFile create a new file in the archive, returning the writer for that file

Jump to

Keyboard shortcuts

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