chunking

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileExists added in v1.7.0

func FileExists(id string) bool

FileExists returns true if a file exists for the given chunk ID

func GetFileByChunkId

func GetFileByChunkId(id string) (*os.File, error)

GetFileByChunkId returns a handle to the chunk file

func NewChunk

func NewChunk(chunkContent io.Reader, fileHeader *multipart.FileHeader, info ChunkInfo) error

NewChunk allocates the space for the new file and writes the chunk

Types

type ChunkInfo

type ChunkInfo struct {
	TotalFilesizeBytes int64
	Offset             int64
	UUID               string
}

ChunkInfo contains info about the current chunk

func ParseChunkInfo

func ParseChunkInfo(r *http.Request, isApiCall bool) (ChunkInfo, error)

ParseChunkInfo parses the posted form data and returns it as a ChunkInfo object

type FileHeader

type FileHeader struct {
	Filename    string
	ContentType string
	Size        int64
}

FileHeader contains info about the uploaded file

func ParseFileHeader

func ParseFileHeader(r *http.Request) (FileHeader, error)

ParseFileHeader parses the formdata and returns a FileHeader

func ParseMultipartHeader

func ParseMultipartHeader(header *multipart.FileHeader) (FileHeader, error)

ParseMultipartHeader converts a multipart.FileHeader to the internal FileHeader

Jump to

Keyboard shortcuts

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