Documentation
¶
Index ¶
Constants ¶
const MultipartFormUploadingType = "multipart_form"
const MultipartPartUploadingType = "multipart_part"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MultipartFormUploader ¶
type MultipartFormUploader struct {
// contains filtered or unexported fields
}
MultipartFormUploader is a service which represents functionality for uploader a full file from *http.Request into storage. This approach of uploading takes a much more RAM but works more fast than MultipartPartUploader. If you care of performance, you need use this approach, but take care of using RAM and set up the appropriate value of 'inMemoryFileSizeThreshold' through env. configuration.
func NewNativeUploader ¶
func NewNativeUploader( logger logger.Logger, storage storager.Storage, filename file.NameComputer, formFilename string, inMemoryFileSizeThreshold int64, ) *MultipartFormUploader
func (*MultipartFormUploader) Upload ¶
func (u *MultipartFormUploader) Upload(reqDTO dto.UploadResourceRequest) (err error)
Upload method will be store a file on a disk and calculate a new hashed name. Request DTO mutation!
type MultipartPartUploader ¶
type MultipartPartUploader struct {
// contains filtered or unexported fields
}
MultipartPartUploader - is a file UploadingStrategy which use multipart.Part. In such case it takes more time but takes much less memory. Approximately, to upload a 50MB file you will need only 10MB of RAM.
func NewPartsUploader ¶
func NewPartsUploader( logger logger.Logger, storage storager.Storage, filename file.NameComputer, ) *MultipartPartUploader
func (*MultipartPartUploader) Upload ¶
func (u *MultipartPartUploader) Upload(reqDTO dto.UploadResourceRequest) (err error)