chunking

package
v1.26.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsChunked

func IsChunked(fn string) (bool, error)

IsChunked checks if a given path refers to a chunk or not.

Types

type ChunkBLOBInfo

type ChunkBLOBInfo struct {
	Path         string
	TransferID   string
	TotalChunks  int
	CurrentChunk int
}

ChunkBLOBInfo stores info about a particular chunk.

func GetChunkBLOBInfo

func GetChunkBLOBInfo(path string) (*ChunkBLOBInfo, error)

GetChunkBLOBInfo decodes a chunk name to retrieve info about it.

type ChunkHandler

type ChunkHandler struct {
	ChunkFolder string `mapstructure:"chunk_folder"`
}

ChunkHandler manages chunked uploads, storing the chunks in a temporary directory until it gets the final chunk which is then returned.

func NewChunkHandler

func NewChunkHandler(chunkFolder string) *ChunkHandler

NewChunkHandler creates a handler for chunked uploads.

func (*ChunkHandler) WriteChunk

func (c *ChunkHandler) WriteChunk(fn string, r io.ReadCloser) (string, string, error)

WriteChunk saves an intermediate chunk temporarily and assembles all chunks once the final one is received.

Jump to

Keyboard shortcuts

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