zip

package
v3.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const Ext = ".zip"

Variables

View Source
var (
	ErrorNotFound    = errors.New("not found")
	ErrorInvalidName = errors.New("invalid name")
)

Functions

func Compress

func Compress(data []byte, name string) ([]byte, error)

Compress compresses the bytes (a single file) with a name specified into a ZIP file (as bytes).

func Read

func Read(zd []byte) ([]byte, string, error)

Read reads a single ZIP file from the bytes array. It will return un-compressed data and the name of that file.

Types

type Extractor

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

func New

func New(log *logger.Logger) Extractor

func (Extractor) Extract

func (e Extractor) Extract(src string, dest string) (files []string, err error)

Jump to

Keyboard shortcuts

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