Documentation
¶
Index ¶
- type AssembleFolder
- type ByChunk
- type ChunkFolder
- type ChunkUpload
- type Destination
- type FileAssembler
- type FileDestination
- func (fd *FileDestination) Create(filename string) (io.WriteCloser, error)
- func (d *FileDestination) Delete(filePath string) error
- func (f *FileDestination) Files() ([]FileSource, error)
- func (f *FileDestination) Reader(subfolder string) FolderSource
- func (f *FileDestination) Remove() error
- func (d *FileDestination) Size(filePath string) int64
- func (fd *FileDestination) Uri(filename string) string
- func (f *FileDestination) Writer(subfolder string) FolderDestination
- type FileFlusher
- type FileSource
- type FileSystemFile
- type FolderDestination
- type FolderSource
- type S3Destination
- type UploadOutcome
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssembleFolder ¶
type AssembleFolder struct {
Callback func(*UploadOutcome)
Data interface{}
Source *ChunkFolder
Destination FolderDestination
// contains filtered or unexported fields
}
func (*AssembleFolder) Notify ¶
func (o *AssembleFolder) Notify()
type ChunkFolder ¶
type ChunkFolder struct {
FolderSource
//final final name
Filename string
// contains filtered or unexported fields
}
folder to assemble
func (*ChunkFolder) IsComplete ¶
func (f *ChunkFolder) IsComplete() bool
type ChunkUpload ¶
type ChunkUpload struct {
CurrentChunkNumber int //flowChunkNumber
CurrentChunkSize int
ChunkSize int
TotalSize int64
Identifier string
Filename string
RelativePath string
TotalChunks int
Destination Destination
}
func (*ChunkUpload) ChunkAlreadyUploaded ¶
func (u *ChunkUpload) ChunkAlreadyUploaded() bool
func (*ChunkUpload) UploadChunk ¶
func (u *ChunkUpload) UploadChunk(src io.Reader) (*ChunkFolder, error)
type Destination ¶
type Destination interface {
Writer(subfolder string) FolderDestination
Reader(subfolder string) FolderSource
}
type FileAssembler ¶
type FileAssembler struct {
Log logging.Logger `inject:""`
// contains filtered or unexported fields
}
FileAssembler - assembles file chunks into files
func (*FileAssembler) Post ¶
func (fa *FileAssembler) Post(folder *AssembleFolder)
func (*FileAssembler) Start ¶
func (fa *FileAssembler) Start()
Start - Start Threads to assemble files.
type FileDestination ¶
type FileDestination struct {
FolderRoot string
// contains filtered or unexported fields
}
func (*FileDestination) Create ¶
func (fd *FileDestination) Create(filename string) (io.WriteCloser, error)
func (*FileDestination) Delete ¶
func (d *FileDestination) Delete(filePath string) error
func (*FileDestination) Files ¶
func (f *FileDestination) Files() ([]FileSource, error)
func (*FileDestination) Reader ¶
func (f *FileDestination) Reader(subfolder string) FolderSource
func (*FileDestination) Remove ¶
func (f *FileDestination) Remove() error
func (*FileDestination) Size ¶
func (d *FileDestination) Size(filePath string) int64
Size() - Gets the file's size. If file doesn't exist, value is less than zero
func (*FileDestination) Uri ¶
func (fd *FileDestination) Uri(filename string) string
func (*FileDestination) Writer ¶
func (f *FileDestination) Writer(subfolder string) FolderDestination
type FileFlusher ¶
type FileFlusher struct {
// contains filtered or unexported fields
}
func (*FileFlusher) Close ¶
func (fd *FileFlusher) Close() error
type FileSource ¶
type FileSystemFile ¶
type FileSystemFile struct {
Path string
}
func (*FileSystemFile) Open ¶
func (f *FileSystemFile) Open() (io.ReadCloser, error)
func (*FileSystemFile) Size ¶
func (f *FileSystemFile) Size() int64
func (*FileSystemFile) Uri ¶
func (f *FileSystemFile) Uri() string
type FolderDestination ¶
type FolderSource ¶
type FolderSource interface {
//returns chunks in sorted order
Files() ([]FileSource, error)
Remove() error
}
FOLDER
type S3Destination ¶
type S3Destination struct {
S3Domain string // "s3-us-west-2.amazonaws.com"
BucketName string // my.bucket.name
AccessKey string
SecretKey string
SecurityToken string
Folder string
}
func (*S3Destination) Create ¶
func (d *S3Destination) Create(filename string) (io.WriteCloser, error)
func (*S3Destination) Delete ¶
func (d *S3Destination) Delete(filename string) error
func (*S3Destination) Size ¶
func (d *S3Destination) Size(filename string) int64
func (*S3Destination) Uri ¶
func (d *S3Destination) Uri(filename string) string
type UploadOutcome ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.