tar_io

package
v0.0.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2016 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Factories = struct {
	TarReceiver *tarReceiverFactory
	TarProvider *tarProviderFactory
}{
	TarReceiver: &tarReceiverFactory{},
	TarProvider: &tarProviderFactory{},
}

Functions

func SaveTarToReceiver

func SaveTarToReceiver(reader io.Reader, tarReceiver TarReceiver) error

func UploadProvider

func UploadProvider(tarProvider TarProvider, handler UploadHandler) error

func WriteToTar

func WriteToTar(tarWriter *tar.Writer, file *TarFile) error

Types

type TarFile

type TarFile struct {
	FileName          string
	ContentReadCloser io.ReadCloser
	IsOnlyFile        bool
	Info              os.FileInfo
}

func NewTarFile

func NewTarFile(fileName string, contentReadCloser io.ReadCloser, isOnlyFile bool, info os.FileInfo) *TarFile

func (*TarFile) HasContent

func (t *TarFile) HasContent() bool

type TarProvider

type TarProvider interface {
	Files() <-chan *TarFile
}

type TarProviderFactory

type TarProviderFactory interface {
	Dir(fullDirPath, filePattern string) TarProvider
	File(fullFilePath string) TarProvider
}

func NewTarProviderFactory

func NewTarProviderFactory() TarProviderFactory

type TarReceiver

type TarReceiver interface {
	OnEntry(tarHeader *tar.Header, tarFileReader io.Reader) error
}

type TarReceiverFactory

type TarReceiverFactory interface {
	Dir(dir string) TarReceiver
	File(file string) TarReceiver
	Writer(writer io.Writer) TarReceiver
}

func NewTarReceiverFactory

func NewTarReceiverFactory() TarReceiverFactory

type UploadHandler

type UploadHandler interface {
	Read(reader io.Reader) error
	Done() error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL