goziputils

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2025 License: MIT Imports: 5 Imported by: 3

README

Go Reference

go get github.com/JJJJJJack/go-zip-utils

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(zipWriter *zip.Writer, f *zip.File) error

CopyFile copies the file f into zipWriter, preserving its original name and compression method.

func ReadZipFileContent

func ReadZipFileContent(f *zip.File) ([]byte, error)

ReadZipFileContent reads the content of a file in a zip archive.

func RewriteFileIntoZipWriter

func RewriteFileIntoZipWriter(zipWriter *zip.Writer, f *zip.File, content []byte) error

RewriteFileIntoZipWriter reacreates the file f in zipWriter with the provided content while preserving the f.FileHeader.

func WriteFile

func WriteFile(zipWriter *zip.Writer, filename string, content []byte) error

WriteFile creates a new file in the zip archive with the given filename

Types

type ZipMap

type ZipMap map[string]*zip.File

func NewZipMapFromBytes

func NewZipMapFromBytes(data []byte) (ZipMap, error)

NewZipMapFromBytes creates a ZipMap from the given byte slice containing zip data.

func NewZipMapFromFilename

func NewZipMapFromFilename(filename string) (ZipMap, error)

NewZipMapFromFilename creates a ZipMap from the given zip filename.

Jump to

Keyboard shortcuts

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