Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chunker ¶
type Chunker struct {
// contains filtered or unexported fields
}
Chunker is a reader that reads from an underlying io.Reader and returns LoadChunkRequests of a given size.
func NewChunker ¶
NewChunker returns a new Chunker that reads from r and returns LoadChunkRequests of size chunkSize.
func (*Chunker) Abort ¶
func (c *Chunker) Abort() *proto.LoadChunkRequest
Abort returns a LoadChunkRequest that signals the receiver to abort the given stream.
type Dechunker ¶
type Dechunker struct {
// contains filtered or unexported fields
}
Dechunker is a writer that writes chunks to a file and returns the file path when the last chunk is received and the Dechunker is closed.
func NewDechunker ¶
NewDechunker returns a new Dechunker that writes chunks to a file in dir.
func (*Dechunker) Close ¶
Close closes the Dechunker and returns the file path containing the reassembled data.
func (*Dechunker) WriteChunk ¶
func (d *Dechunker) WriteChunk(chunk *proto.LoadChunkRequest) (bool, error)
WriteChunk writes the chunk to the file. If the chunk is the last chunk, the the bool return value is true.
type DechunkerManager ¶
type DechunkerManager struct {
// contains filtered or unexported fields
}
DechunkerManager manages Dechunkers.
func NewDechunkerManager ¶
func NewDechunkerManager(dir string) (*DechunkerManager, error)
NewDechunkerManager returns a new DechunkerManager.
func (*DechunkerManager) Close ¶
func (d *DechunkerManager) Close()
Closes closes the DechunkerManager and all Dechunkers it manages.
func (*DechunkerManager) Delete ¶
func (d *DechunkerManager) Delete(id string)
Delete deletes the Dechunker for the given stream ID.