Back to godoc.org
github.com/bufbuild/buf / internal / pkg / storage / storagearchive

Package storagearchive

v0.20.5
Latest Go to latest

The latest major version is .

Published: Jul 24, 2020 | License: Apache-2.0 | Module: github.com/bufbuild/buf

Overview

Package storagearchive implements archive utilities.

Index

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,
) (retErr error)

Zip zips the given bucket to the writer.

Only regular files are added to the writer.

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier