Documentation ¶
Index ¶
- Variables
- func GenerateTar(genFn func(TarWriter) error) io.ReadCloser
- func GenerateTarWithWriter(genFn func(TarWriter) error, twf TarWriterFactory) io.ReadCloser
- func NormalizeHeader(header *tar.Header, normalizeModTime bool)
- func ReadZipAsTar(srcPath, basePath string, uid, gid int, mode int64, normalizeModTime bool, ...) io.ReadCloser
- func WriteZipToTar(tw TarWriter, srcZip, basePath string, uid, gid int, mode int64, ...) error
- type TarBuilder
- func (t *TarBuilder) AddDir(path string, mode int64, modTime time.Time)
- func (t *TarBuilder) AddFile(path string, mode int64, modTime time.Time, contents []byte)
- func (t *TarBuilder) Reader(twf TarWriterFactory) io.ReadCloser
- func (t *TarBuilder) WriteTo(w io.Writer, twf TarWriterFactory) (int64, error)
- func (t *TarBuilder) WriteToPath(path string, twf TarWriterFactory) error
- type TarWriter
- type TarWriterFactory
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEntryNotExist = errors.New("not exist")
ErrEntryNotExist is an error returned if an entry path doesn't exist
View Source
var NormalizedDateTime time.Time
Functions ¶
func GenerateTar ¶
func GenerateTar(genFn func(TarWriter) error) io.ReadCloser
func GenerateTarWithWriter ¶
func GenerateTarWithWriter(genFn func(TarWriter) error, twf TarWriterFactory) io.ReadCloser
GenerateTarWithTar returns a reader to a tar from a generator function using a writer from the provided factory. Note that the generator will not fully execute until the reader is fully read from. Any errors returned by the generator will be returned when reading the reader.
func NormalizeHeader ¶
NormalizeHeader normalizes a tar.Header
Normalizes the following:
- ModTime
- GID
- UID
- User Name
- Group Name
func ReadZipAsTar ¶
Types ¶
type TarBuilder ¶
type TarBuilder struct {
// contains filtered or unexported fields
}
func (*TarBuilder) Reader ¶
func (t *TarBuilder) Reader(twf TarWriterFactory) io.ReadCloser
func (*TarBuilder) WriteTo ¶
func (t *TarBuilder) WriteTo(w io.Writer, twf TarWriterFactory) (int64, error)
func (*TarBuilder) WriteToPath ¶
func (t *TarBuilder) WriteToPath(path string, twf TarWriterFactory) error
type TarWriterFactory ¶
func DefaultTarWriterFactory ¶
func DefaultTarWriterFactory() TarWriterFactory
Click to show internal directories.
Click to hide internal directories.