archive

package
v0.69.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: Apache-2.0 Imports: 10 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 archives the given sources into dest, selecting the format by dest's extension.

func Decompress

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

Decompress extracts source into dst, using strip or filter logic per opts, then optionally nests.

Types

type CompressOpts

type CompressOpts struct{}

CompressOpts holds future optional parameters for Compress.

type DecompressOpts

type DecompressOpts struct {
	// UnarchiveAll enables recursive unpacking of nested .tar files.
	UnarchiveAll bool
	// Files restricts extraction to these archive paths if non-empty.
	Files []string
	// StripComponents drops leading path elements from each entry.
	StripComponents int
	// OverwriteExisting truncates existing files instead of erroring.
	OverwriteExisting bool
	// SkipValidation suppresses errors for missing Files entries.
	SkipValidation bool
	// Extractor allows the user to specify which extractor should be used for decompression.
	// If this is not set it will be determined automatically from the file extension
	Extractor archives.Extractor
}

DecompressOpts defines optional behavior for Decompress.

Jump to

Keyboard shortcuts

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