upload

package module
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

README

Go uploader package

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chunk

type Chunk struct {
	ID        string
	Hash      string
	CreatedAt time.Time
}

type CreateUploadResponse

type CreateUploadResponse struct {
	UploadId string
}

type DownloadRequest

type DownloadRequest struct {
	UploadId string
}

type File

type File struct {
	UploadId string
	Filename string
	Size     uint64
}

type FileChunk

type FileChunk struct {
	Hash        string
	ChunkNumber int
}

type FileController

type FileController struct {
	// contains filtered or unexported fields
}

func (*FileController) Download

func (c *FileController) Download(ctx *gin.Context)

func (*FileController) NewUpload

func (c *FileController) NewUpload(ctx *gin.Context)

func (*FileController) Reassemble

func (c *FileController) Reassemble(ctx *gin.Context)

func (*FileController) UploadChunk

func (c *FileController) UploadChunk(ctx *gin.Context)

type ReassembleChunksRequest

type ReassembleChunksRequest struct {
	UploadId string
	Chunks   []FileChunk
	Filename string
}

type ReassembleChunksResponse

type ReassembleChunksResponse struct {
	Hash     string
	Filename string
}

type UploadChunkResponse

type UploadChunkResponse struct {
	ID   string
	Hash string
}

type UploadService

type UploadService struct {
}

func (UploadService) CreateUpload

func (u UploadService) CreateUpload() CreateUploadResponse

func (UploadService) Download

func (u UploadService) Download(req DownloadRequest, header http.Header, writer io.Writer) error

func (UploadService) ReassembleChunk

ReassembleChunk put chunks together

func (UploadService) UploadChunk

func (u UploadService) UploadChunk(req *http.Request) (*UploadChunkResponse, error)

UploadChunk upload each 4MB chunk of a file

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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