Documentation ¶
Index ¶
Constants ¶
View Source
const UPLOAD_BUFFER_SIZE = 100
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorNotifierHarness ¶
type ErrorNotifierHarness interface {
SendError(error)
}
type Factory ¶
type Factory interface {
NewUploader() Uploader
}
Factory is an interface to an object that makes new Uploader instances
func NewFactory ¶
func NewFactory(bucket string, keynameGenerator S3KeyNameGenerator, s3Uploader s3manageriface.UploaderAPI) Factory
type FileTypeHeader ¶
type FileTypeHeader string
const ( Gzip FileTypeHeader = "application/x-gzip" Text FileTypeHeader = "text/plain" )
type NotifierHarness ¶
type NotifierHarness interface {
SendMessage(*UploadReceipt) error
}
type S3KeyNameGenerator ¶
type UploadReceipt ¶
type UploadRequest ¶
type UploadRequest struct { Filename string FileType FileTypeHeader // contains filtered or unexported fields }
type Uploader ¶
type Uploader interface {
Upload(*UploadRequest) (*UploadReceipt, error)
}
Uploader is an interface for uploading files
type UploaderPool ¶
type UploaderPool struct { Pool []Uploader Notifier NotifierHarness ErrorNotifier ErrorNotifierHarness // contains filtered or unexported fields }
func StartUploaderPool ¶
func StartUploaderPool( numWorkers int, errorNotifier ErrorNotifierHarness, notifier NotifierHarness, builder Factory, ) *UploaderPool
func (*UploaderPool) Close ¶
func (p *UploaderPool) Close()
func (*UploaderPool) Crank ¶
func (p *UploaderPool) Crank()
func (*UploaderPool) Upload ¶
func (p *UploaderPool) Upload(req *UploadRequest)
Click to show internal directories.
Click to hide internal directories.