chunk

package
v0.0.0-...-57b748c Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChunkList

type ChunkList struct {
	Size      int
	TotalSize int
	Segments  []Range
	Count     int
}

Chunks: The file that we want to download will be split into multiple pieces represented

as Chunks. It captures info about the number of pieces, size of each piece and the
interval of each piece (its starting and ending byte value)

segments: [[0,n1],[n1+1,n1+chunkSize]....[,n]]

func (*ChunkList) ComputeChunks

func (c *ChunkList) ComputeChunks()

ComputeChunks: Compute chunks for a given parts(thread count).

func (*ChunkList) Merge

func (c *ChunkList) Merge(outputName string, sessionID string) error

Merge all segments into a single file.

type Range

type Range struct {
	Start int
	End   int
}

Range represents the interval of the segment.

Jump to

Keyboard shortcuts

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