common

package
v2.5.2 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TarGzipWriter

type TarGzipWriter struct {
	// contains filtered or unexported fields
}

TarGzipWriter is a valid io.WriteCloser. It implements WriteHeader from tar.Writer to create separate files within the tar archive.

func NewTarGzipWriter

func NewTarGzipWriter(w io.Writer) *TarGzipWriter

NewTarGzipWriter creates a new TarGzipWriter.

func (*TarGzipWriter) Close

func (t *TarGzipWriter) Close() error

Close closes the inner tar.Writer and then subsequently the outer gzip.Writer.

It returns the error of either call after both writers have been closed. If both calls to each writer.Close() error, then the error of closing the gzip.Writer is returned.

The downstream writer is left as it is, i.e. it must be closed independently.

func (*TarGzipWriter) Write

func (t *TarGzipWriter) Write(p []byte) (int, error)

Write adds content to the current file in the tar gzip archive; see tar.Writer.

func (*TarGzipWriter) WriteHeader

func (t *TarGzipWriter) WriteHeader(hdr *tar.Header) error

WriteHeader starts a new file in the tar archive; see tar.Writer.

Jump to

Keyboard shortcuts

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