Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Compressor ¶
type Compressor interface { Path() string // Path returns the path to the archive AddFile(name string, path string) // AddFile adds the file from path as name to the archive AddDirectory(path string) // AddDirectory adds all files from within a directory Close() error // Close creates and closes the archive }
Compressor defines the interface a compressor needs to implement
type TarballCompressor ¶
type TarballCompressor struct {
// contains filtered or unexported fields
}
TarballCompressor is used to create tgz files
func NewTarball ¶
func NewTarball(path string) *TarballCompressor
NewTarball returns a new TarballCompressor instance
func (*TarballCompressor) AddDirectory ¶
func (archive *TarballCompressor) AddDirectory(dirPath string)
AddDirectory adds all files from within a directory
func (*TarballCompressor) AddFile ¶
func (archive *TarballCompressor) AddFile(name string, path string)
AddFile adds the file from path as name to the archive
If name is not specified, the basename of path is used
func (*TarballCompressor) Close ¶
func (archive *TarballCompressor) Close() error
Close creates and closes the archive
func (*TarballCompressor) Path ¶
func (archive *TarballCompressor) Path() string
Path returns the path to the tgz file
type ZipCompressor ¶
type ZipCompressor struct {
// contains filtered or unexported fields
}
ZipCompressor is used to create zip files
func (*ZipCompressor) AddDirectory ¶
func (archive *ZipCompressor) AddDirectory(dirPath string)
AddDirectory adds all files from within a directory
func (*ZipCompressor) AddFile ¶
func (archive *ZipCompressor) AddFile(name string, path string)
AddFile adds the file from path as name to the archive
If name is not specified, the basename of path is used
func (*ZipCompressor) Close ¶
func (archive *ZipCompressor) Close() error
Close creates and closes the archive
func (*ZipCompressor) Path ¶
func (archive *ZipCompressor) Path() string
Path returns the path to the zip file