storagearchive

package
v0.52.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package storagearchive implements archive utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Tar

func Tar(
	ctx context.Context,
	readBucket storage.ReadBucket,
	writer io.Writer,
) (retErr error)

Tar tars the given bucket to the writer.

Only regular files are added to the writer. All files are written as 0644.

func Untar

func Untar(
	ctx context.Context,
	reader io.Reader,
	writeBucket storage.WriteBucket,
	mapper storage.Mapper,
	stripComponentCount uint32,
) error

Untar untars the given tar archive from the reader into the bucket.

Only regular files are added to the bucket.

Paths from the tar archive will be mapped before adding to the bucket. Mapper can be nil. StripComponents happens before the mapper.

func Unzip

func Unzip(
	ctx context.Context,
	readerAt io.ReaderAt,
	size int64,
	writeBucket storage.WriteBucket,
	mapper storage.Mapper,
	stripComponentCount uint32,
) error

Unzip unzips the given zip archive from the reader into the bucket.

Only regular files are added to the bucket.

Paths from the zip archive will be mapped before adding to the bucket. Mapper can be nil. StripComponents happens before the mapper.

func Zip

func Zip(
	ctx context.Context,
	readBucket storage.ReadBucket,
	writer io.Writer,
	compressed bool,
) (retErr error)

Zip zips the given bucket to the writer.

Only regular files are added to the writer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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