memzip

package module
v0.0.0-...-8d72b66 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: MIT Imports: 5 Imported by: 1

README

Memzip

Brief Overview

  • MemZip is a simple Golang package which acts as a wrapper for the archive/zip package.
  • It is very useful for making zip archives in memory so that no files need to be dropped.
  • It supports copying existing files and directories, as well as writing new ones.

Installation

  • MemZip can be installed using the go get github.com/SecDbg/memzip command.

Usage

  • An example of how MemZip can be used can be found in the example/main.go file.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ZipArchive

type ZipArchive struct {
	// contains filtered or unexported fields
}

func NewZipArchive

func NewZipArchive() *ZipArchive

Creates a new in-memory ZIP archive

func (*ZipArchive) AddPath

func (za *ZipArchive) AddPath(srcPath string, destPath ...string) error

Adds an existing file or directory to the archive with an optional destination path

func (*ZipArchive) Close

func (za *ZipArchive) Close() ([]byte, error)

Closes the zip archive and returns the contents

func (*ZipArchive) CreateFile

func (za *ZipArchive) CreateFile(fileName, content string) error

Creates a new file in the archive

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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