archive

package
v0.55.3 Latest Latest
Warning

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

Go to latest
Published: May 21, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package archive contains the SDK for Zarf archival and compression.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compress

func Compress(ctx context.Context, sources []string, dest string, _ CompressOpts) (err error)

Compress takes any number of source files and archives them into a compressed archive at dest path.

func Decompress

func Decompress(ctx context.Context, sourceArchive, dst string, opts DecompressOpts) (err error)

Decompress takes a Zarf package or arbitrary archive and decompresses it to dst.

Types

type CompressOpts

type CompressOpts struct{}

CompressOpts is a placeholder for future optional Compress params

type DecompressOpts

type DecompressOpts struct {
	// UnarchiveAll walks root of the archive and unpacks nested .tar files.
	UnarchiveAll bool

	// Files, if non-empty, means "only extract these exact archive-paths."
	Files []string

	// StripComponents drops this many leading path elements from every entry.
	StripComponents int

	// OverwriteExisting, if true, will truncate existing files instead of failing.
	OverwriteExisting bool

	// SkipValidation, if true, will skip the validation of a file being present in the archive.
	// This is used with unarchiveFiltered to avoid checking for files that are not in the archive.
	// This was a previous behavior that the new logic does not support.
	SkipValidation bool
}

DecompressOpts provides optional parameters for Decompress

Jump to

Keyboard shortcuts

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