handler

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

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

func (s *MCFileStore) GetUpload(ctx context.Context, id string) (upload handler.Upload, err error)

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 (u *MCFileUpload) ConcatUploads(ctx context.Context, uploads []handler.Upload) (err error)

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) GetInfo

func (u *MCFileUpload) GetInfo(ctx context.Context) (info handler.FileInfo, err error)

func (*MCFileUpload) GetReader

func (u *MCFileUpload) GetReader(ctx context.Context) (io.ReadCloser, error)

func (*MCFileUpload) Terminate

func (u *MCFileUpload) Terminate(ctx context.Context) error

func (*MCFileUpload) WriteChunk

func (u *MCFileUpload) WriteChunk(ctx context.Context, offset int64, src io.Reader) (int64, error)

Jump to

Keyboard shortcuts

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