upload

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByFilename

type ByFilename []os.FileInfo

ByFilename helper struct to sort chunk files. Since chunk files are named their chunk number it is easy to sort them out.

func (ByFilename) Len

func (a ByFilename) Len() int

func (ByFilename) Less

func (a ByFilename) Less(i, j int) bool

func (ByFilename) Swap

func (a ByFilename) Swap(i, j int)

type Service

type Service struct {
	FileService        mahi.FileService
	UsageService       mahi.UsageService
	ApplicationService mahi.ApplicationService

	ChunkUploadDir    string
	FullFileDir       string
	MaxChunkSize      int64
	MaxUploadFileSize int64

	Log zerolog.Logger
}

func (*Service) ChunkUpload

func (s *Service) ChunkUpload(ctx context.Context, r *multipart.Reader) error

func (*Service) CompleteChunkUpload

func (s *Service) CompleteChunkUpload(ctx context.Context, applicationID, uploadID, filename string) (*mahi.File, error)

func (*Service) Upload

func (s *Service) Upload(ctx context.Context, r *multipart.Reader) (*mahi.File, error)

Jump to

Keyboard shortcuts

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