chunks

package
v0.0.0-...-dac2ecc Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ChunkSize = 1024

Variables

This section is empty.

Functions

This section is empty.

Types

type Chunk

type Chunk struct {
	ChunkID
	Data []byte
}

type ChunkID

type ChunkID struct {
	FileID      int64
	ChunkNumber int64
}

type ChunkMap

type ChunkMap struct {
	Chunks map[string]ChunkID
	Mu     *sync.Mutex
}

func NewChunkMap

func NewChunkMap() ChunkMap

func (*ChunkMap) AddChunk

func (cm *ChunkMap) AddChunk(buf []byte, chunkID ChunkID) (ChunkID, bool)

func (ChunkMap) GetFileChunks

func (cm ChunkMap) GetFileChunks(baseDir string, fileID int64, path string) chan Chunk

Jump to

Keyboard shortcuts

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