tar

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildTar

func BuildTar(fs vfs.FileSystem, root string, buf io.Writer) error

BuildTar creates a new tar based on a filesystem and a path. The tar is written to the given io.Writer.

func BuildTarGzip

func BuildTarGzip(fs vfs.FileSystem, root string, buf io.Writer) error

BuildTarGzip creates a new compressed tar based on a filesystem and a path. The tar is written to the given io.Writer.

func ExtractTar

func ExtractTar(ctx context.Context, tarStream io.Reader, fs vfs.FileSystem, opts ...ExtractTarOption) error

ExtractTar extracts the content of a tar to the given filesystem with the given root base path

func ExtractTarGzip

func ExtractTarGzip(ctx context.Context, gzipStream io.Reader, fs vfs.FileSystem, opts ...ExtractTarOption) error

ExtractTarGzip extracts the content of a tar to the given filesystem with the given root base path

Types

type ExtractTarOption

type ExtractTarOption interface {
	ApplyOption(opts *ExtractTarOptions)
}

ExtractTarOption defines a interface to apply tar options.

type ExtractTarOptions

type ExtractTarOptions struct {
	Path      string
	Overwrite bool
}

ExtractTarOptions describes optional untar options.

func (*ExtractTarOptions) ApplyOptions

func (opts *ExtractTarOptions) ApplyOptions(options []ExtractTarOption)

ApplyOptions applies all tar options to the current options.

type Overwrite

type Overwrite bool

Overwrite configures if files/directories should be overwritten while untar.

func (Overwrite) ApplyOption

func (o Overwrite) ApplyOption(opts *ExtractTarOptions)

type ToPath

type ToPath string

ToPath configures the path where should be exported to.

func (ToPath) ApplyOption

func (p ToPath) ApplyOption(opts *ExtractTarOptions)

Jump to

Keyboard shortcuts

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