archiver

package
v0.18.5 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddZipFiles

func AddZipFiles(w *zip.Writer, basePath, baseInZip string) error

AddZipFiles recursively adds files from a directory to a zip archive.

func ContainedSymlink(root, name string) (string, error)

ContainedSymlink rejects absolute, broken, and escaping links. Checking the resolved target also catches escapes through intermediate directory symlinks.

func ContextReader

func ContextReader(ctx context.Context, r io.Reader) io.Reader

ContextReader makes copying large files interruptible between reads.

func CreateZip

func CreateZip(baseFolder, zipFile string) error

CreateZip creates a zip archive from a source directory.

func Unzip

func Unzip(r *zip.Reader, dest string) error

Unzip extracts a zip archive to a destination directory.

func WriteTarGz

func WriteTarGz(ctx context.Context, w io.Writer, dir string, exclude func(string) bool) (err error)

WriteTarGz writes the contents of dir without an enclosing directory. It preserves permissions and relative symlinks, but never follows symlinks. exclude receives slash-separated paths relative to dir.

Types

This section is empty.

Jump to

Keyboard shortcuts

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