buf: github.com/bufbuild/buf/internal/pkg/storage/storagearchive Index | Files

package storagearchive

import "github.com/bufbuild/buf/internal/pkg/storage/storagearchive"

Package storagearchive implements archive utilities.

Index

Package Files

storagearchive.go

func Tar Uses

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 Uses

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 Uses

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 Uses

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.

Package storagearchive imports 10 packages (graph) and is imported by 2 packages. Updated 2020-07-08. Refresh now. Tools for package owners.