archive

package
v0.0.0-...-489a7b1 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTarGz

func CreateTarGz(path, directory string) error

CreateTarGz packs a directory into a gzipped archive.

Written to a temporary file and renamed, so an interrupted repack cannot leave a truncated bundle where the container expects a valid one.

func CreateTarGzFiles

func CreateTarGzFiles(path, directory string, files []string) error

CreateTarGzFiles packs the named files, relative to directory, into a gzipped archive.

Only the listed files are packed, and no directory entries are written -- `tar.create(..., files)` with an explicit list behaves the same way, and the build unpacks with the parents created on demand. Symlinks are resolved and stored as the file they point at, matching node-tar's `follow: true`, so a function sharing code through a link deploys the code rather than a dangling link.

The archive is streamed to disk one file at a time. Nothing accumulates in memory, which is what keeps a large site's peak RSS flat -- see the note on deploy.Upload.

func ExtractTarGz

func ExtractTarGz(path, destination string) error

ExtractTarGz unpacks an archive into a directory.

func SafeJoin

func SafeJoin(destination, name string) (string, error)

SafeJoin resolves an archive entry inside the destination, refusing to escape.

An archive entry named `../../.ssh/authorized_keys` would otherwise be written outside the staging directory. The bundle comes from the user's own build, but it is still untrusted input to this process.

Types

This section is empty.

Jump to

Keyboard shortcuts

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