go-james: github.com/pieterclaerhout/go-james/internal/common/compressors Index | Files

package compressors

import "github.com/pieterclaerhout/go-james/internal/common/compressors"

Index

Package Files

common.go tarball.go zip.go

type Compressor Uses

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 Uses

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

TarballCompressor is used to create tgz files

func NewTarball Uses

func NewTarball(path string) *TarballCompressor

NewTarball returns a new TarballCompressor instance

func (*TarballCompressor) AddDirectory Uses

func (archive *TarballCompressor) AddDirectory(dirPath string)

AddDirectory adds all files from within a directory

func (*TarballCompressor) AddFile Uses

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 Uses

func (archive *TarballCompressor) Close() error

Close creates and closes the archive

func (*TarballCompressor) Path Uses

func (archive *TarballCompressor) Path() string

Path returns the path to the tgz file

type ZipCompressor Uses

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

ZipCompressor is used to create zip files

func NewZip Uses

func NewZip(path string) *ZipCompressor

NewZip returns a new ZipCompressor instance

func (*ZipCompressor) AddDirectory Uses

func (archive *ZipCompressor) AddDirectory(dirPath string)

AddDirectory adds all files from within a directory

func (*ZipCompressor) AddFile Uses

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 Uses

func (archive *ZipCompressor) Close() error

Close creates and closes the archive

func (*ZipCompressor) Path Uses

func (archive *ZipCompressor) Path() string

Path returns the path to the zip file

Package compressors imports 8 packages (graph) and is imported by 1 packages. Updated 2019-12-14. Refresh now. Tools for package owners.