tgz

package
v0.0.0-...-2d2ca90 Latest Latest
Warning

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

Go to latest
Published: May 29, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

func List(r *Reader) ([]*tar.Header, error)

List reads and lists entries read from a reader.

func ListFile

func ListFile(fn string) ([]*tar.Header, error)

ListFile list regular files in a .tar.gz file.

func Synthesize

func Synthesize(w *Writer) error

Synthesize generates a tar.gz file for testing.

func SynthesizeTarball

func SynthesizeTarball(dir string) (string, error)

SynthesizeTarball generates a tarball file.

Types

type Reader

type Reader struct {
	*tar.Reader
	// contains filtered or unexported fields
}

Reader includes a tar reader and its underlying readers.

func NewReader

func NewReader(r io.Reader) (*Reader, error)

NewReader wraps an io.Reader into a Reader.

func OpenFile

func OpenFile(fn string) (*Reader, error)

OpenFile returns a Reader

func (*Reader) Close

func (r *Reader) Close() error

Close calls gzip.Reader.Close() and os.File.Close if the underlying storage is a file.

type Writer

type Writer struct {
	*tar.Writer
	// contains filtered or unexported fields
}

Writer defines a writer to a .tar.gz file.

func CreateFile

func CreateFile(fn string) (*Writer, error)

CreateFile creates a writer.

func NewWriter

func NewWriter(r io.Writer) *Writer

NewWriter wraps an io.Writer into a Writer

func (*Writer) Close

func (w *Writer) Close() error

Close calls the tar.Writer.Close(), gzip.Writer.Close(), and if the underlying storage is a file, os.File.Close().

Jump to

Keyboard shortcuts

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