Documentation ¶
Index ¶
- func NewFilterWriter(glob string, writer types.ArchiveWriter) types.ArchiveWriter
- func NewPrefixWriter(prefix string, writer types.ArchiveWriter) types.ArchiveWriter
- func NewSingleFileWriter(filename string, writer io.Writer) types.ArchiveWriter
- func NewSubDirZipWriter(baseFolder string, zipWriter *zip.Writer) types.ArchiveWriter
- type TarArchive
- type TextArchive
- type ZipArchive
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) 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) 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) CurrentFileName ¶
func (a *ZipArchive) CurrentFileName() string