Documentation
      ¶
    
    
  
    
  
    Index ¶
- type MCFileStore
 - func (s *MCFileStore) AsConcatableUpload(upload handler.Upload) handler.ConcatableUpload
 - func (s *MCFileStore) AsLengthDeclarableUpload(upload handler.Upload) handler.LengthDeclarableUpload
 - func (s *MCFileStore) AsTerminatableUpload(upload handler.Upload) handler.TerminatableUpload
 - func (s *MCFileStore) GetUpload(ctx context.Context, id string) (upload handler.Upload, err error)
 - func (s *MCFileStore) NewUpload(ctx context.Context, info handler.FileInfo) (upload handler.Upload, err error)
 - func (s *MCFileStore) UseIn(composer *handler.StoreComposer)
 
- type MCFileUpload
 - func (u *MCFileUpload) ConcatUploads(ctx context.Context, uploads []handler.Upload) (err error)
 - func (u *MCFileUpload) DeclareLength(ctx context.Context, length int64) error
 - func (u *MCFileUpload) FinishUpload(ctx context.Context) error
 - func (u *MCFileUpload) GetInfo(ctx context.Context) (info handler.FileInfo, err error)
 - func (u *MCFileUpload) GetReader(ctx context.Context) (io.ReadCloser, error)
 - func (u *MCFileUpload) Terminate(ctx context.Context) error
 - func (u *MCFileUpload) WriteChunk(ctx context.Context, offset int64, src io.Reader) (int64, error)
 
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MCFileStore ¶
type MCFileStore struct {
	// contains filtered or unexported fields
}
    func NewMCFileStore ¶
func NewMCFileStore(db *gorm.DB, chunksDir string) *MCFileStore
func (*MCFileStore) AsConcatableUpload ¶
func (s *MCFileStore) AsConcatableUpload(upload handler.Upload) handler.ConcatableUpload
func (*MCFileStore) AsLengthDeclarableUpload ¶
func (s *MCFileStore) AsLengthDeclarableUpload(upload handler.Upload) handler.LengthDeclarableUpload
func (*MCFileStore) AsTerminatableUpload ¶
func (s *MCFileStore) AsTerminatableUpload(upload handler.Upload) handler.TerminatableUpload
func (*MCFileStore) GetUpload ¶
GetUpload fetches the upload with a given ID. If no such upload can be found, ErrNotFound must be returned.
func (*MCFileStore) NewUpload ¶
func (s *MCFileStore) NewUpload(ctx context.Context, info handler.FileInfo) (upload handler.Upload, err error)
NewUpload creates a new upload using the size as the file's length. The method must return a unique id which is used to identify the upload. If no backend (e.g. Riak) specifes the id you may want to use the uid package to generate one. The properties Size and MetaData will be filled.
func (*MCFileStore) UseIn ¶
func (s *MCFileStore) UseIn(composer *handler.StoreComposer)
type MCFileUpload ¶
type MCFileUpload struct {
	MCFSDir  string
	FileInfo handler.FileInfo
	ProjectID   int
	DirectoryID int
	OwnerID     int
	Filename    string
	// contains filtered or unexported fields
}
    func (*MCFileUpload) ConcatUploads ¶
func (*MCFileUpload) DeclareLength ¶
func (u *MCFileUpload) DeclareLength(ctx context.Context, length int64) error
func (*MCFileUpload) FinishUpload ¶
func (u *MCFileUpload) FinishUpload(ctx context.Context) error
func (*MCFileUpload) GetReader ¶
func (u *MCFileUpload) GetReader(ctx context.Context) (io.ReadCloser, error)
func (*MCFileUpload) WriteChunk ¶
 Click to show internal directories. 
   Click to hide internal directories.