Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MediaType ¶
MediaType determines the mime media type for the given file. Because MaterialsCommons stores the file by id, which is different from the filename, the name and the path are passed. The name allows us to try and determine the file type by its extension.
func NewIDService ¶
NewIDService creates a new idService that connects to the database using the given session.
func NewUploadService ¶
NewUploadService creates a new idService that connects to the database using the given session.
Types ¶
type IDRequest ¶
type IDRequest struct { User string DirectoryID string ProjectID string FileName string FileSize int64 Checksum string ChunkSize int32 FileMTime time.Time Host string Birthtime time.Time }
A IDRequest requests a new upload id be created for the given parameters.
type IDService ¶
type IDService interface { ID(req IDRequest) (*schema.Upload, error) Delete(requestID, user string) error UploadsForProject(projectID string) ([]schema.Upload, error) }
IDService creates new upload requests
type UploadRequest ¶
A UploadRequest contains the block to upload and the information required to write that block.
type UploadService ¶
type UploadService interface {
Upload(req *UploadRequest) (*UploadStatus, error)
}
UploadService takes care of uploading blocks and constructing the file when all blocks have been uploaded.