archivewriter

package
v0.0.0-...-d79780e Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFilterWriter

func NewFilterWriter(glob string, writer types.ArchiveWriter) types.ArchiveWriter

NewFilterWriter returns an ArchiveWriter that write to underlying writer but only filename matching given glob. For file not matching the prefix, data written are discarded.

func NewPrefixWriter

func NewPrefixWriter(prefix string, writer types.ArchiveWriter) types.ArchiveWriter

NewPrefixWriter returns an ArchiveWriter that write to underlying writer but add a fixed prefix to all filename. The prefix could end with "/" making write being in a sub-folder.

func NewSingleFileWriter

func NewSingleFileWriter(filename string, writer io.Writer) types.ArchiveWriter

NewSingleFileWriter returns an ArchiveWriter that write unmodified only filename that exactly match given filename. Other files data are discarded.

func NewSubDirZipWriter

func NewSubDirZipWriter(baseFolder string, zipWriter *zip.Writer) types.ArchiveWriter

NewSubDirZipWriter returns an ArchiveWriter able to write directly into the given zip archive. Every call to Create will create a file in the given base folder. It's up to the caller to close the given zip.Writer once everything is done.

Types

type TarArchive

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

func NewTarWriter

func NewTarWriter(w io.Writer) *TarArchive

func (*TarArchive) Close

func (a *TarArchive) Close() error

func (*TarArchive) Create

func (a *TarArchive) Create(filename string) (io.Writer, error)

func (*TarArchive) CurrentFileName

func (a *TarArchive) CurrentFileName() string

type TextArchive

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

func NewTextArchive

func NewTextArchive(w io.Writer) *TextArchive

func (*TextArchive) Close

func (a *TextArchive) Close() error

func (*TextArchive) Create

func (a *TextArchive) Create(filename string) (io.Writer, error)

func (*TextArchive) CurrentFileName

func (a *TextArchive) CurrentFileName() string

type ZipArchive

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

func NewZipWriter

func NewZipWriter(w io.Writer) *ZipArchive

func (*ZipArchive) Close

func (a *ZipArchive) Close() error

func (*ZipArchive) Create

func (a *ZipArchive) Create(filename string) (io.Writer, error)

func (*ZipArchive) CurrentFileName

func (a *ZipArchive) CurrentFileName() string

Jump to

Keyboard shortcuts

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