upload

package
v0.0.0-...-bd0efcb Latest Latest
Warning

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

Go to latest
Published: Dec 14, 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        baas.FileService
	UsageService       baas.UsageService
	ApplicationService baas.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) (*baas.File, error)

func (*Service) Upload

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

Jump to

Keyboard shortcuts

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