archivex: github.com/jhoonb/archivex Index | Files

package archivex

import "github.com/jhoonb/archivex"

Index

Package Files

archivex.go

type ArchiveWriteFunc Uses

type ArchiveWriteFunc func(info os.FileInfo, file io.Reader, entryName string) (err error)

ArchiveWriteFunc is the closure used by an archive's AddAll method to actually put a file into an archive Note that for directory entries, this func will be called with a nil 'file' param

type Archivex Uses

type Archivex interface {
    Create(name string) error
    CreateWriter(name string, w io.Writer) error
    Add(name string, file io.Reader, info os.FileInfo) error
    AddAll(dir string, includeCurrentFolder bool) error
    Close() error
}

interface

type TarFile Uses

type TarFile struct {
    Writer     *tar.Writer
    Name       string
    GzWriter   *gzip.Writer
    Compressed bool
    // contains filtered or unexported fields
}

TarFile implement *tar.Writer

func (*TarFile) Add Uses

func (t *TarFile) Add(name string, file io.Reader, info os.FileInfo) error

Add add byte in archive tar

func (*TarFile) AddAll Uses

func (t *TarFile) AddAll(dir string, includeCurrentFolder bool) error

AddAll adds all files from dir in archive Tar does not support directories

func (*TarFile) Close Uses

func (t *TarFile) Close() error

Close the file Tar

func (*TarFile) Create Uses

func (t *TarFile) Create(name string) error

Create new Tar file

func (*TarFile) CreateWriter Uses

func (t *TarFile) CreateWriter(name string, w io.Writer) error

Create a new Tar and write it to a given writer

type ZipFile Uses

type ZipFile struct {
    Writer *zip.Writer
    Name   string
    // contains filtered or unexported fields
}

ZipFile implement *zip.Writer

func (*ZipFile) Add Uses

func (z *ZipFile) Add(name string, file io.Reader, info os.FileInfo) error

Add file reader in archive zip

func (*ZipFile) AddAll Uses

func (z *ZipFile) AddAll(dir string, includeCurrentFolder bool) error

AddAll adds all files from dir in archive, recursively. Directories receive a zero-size entry in the archive, with a trailing slash in the header name, and no compression

func (*ZipFile) Close Uses

func (z *ZipFile) Close() error

Close close the zip file

func (*ZipFile) Create Uses

func (z *ZipFile) Create(name string) error

Create new file zip

func (*ZipFile) CreateWriter Uses

func (z *ZipFile) CreateWriter(name string, w io.Writer) error

Create a new ZIP and write it to a given writer

Package archivex imports 12 packages (graph) and is imported by 29 packages. Updated 2018-07-19. Refresh now. Tools for package owners.