chunk

package
v0.0.0-...-ba7cdbd Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2014 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package chunk includes several data chunking algorithms.

This package only defines the interfaces used for chunking. See each subpackage for the relevant algorithms.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chunker

type Chunker interface {
	io.Writer
	// Flush causes the chunker to write its current buffer
	// using its ChunkWriter.
	Flush() error
	// Reset prepares the chunker for a new chunk of data.
	// Chunkers should automatically reset themselves after
	// being flushed.
	Reset()
	// Remaining returns the data in the chunker's buffer.
	Remaining() []byte
}

Chunker is the interface implemented by all the chunkers. A Chunker receives a stream of data and splits it into chunks, which are written by its ChunkWriter (usually implemented by the caller.

type Writer

type Writer interface {
	// WriteChunk will be called once per chunk and all chunks
	// will be non-empty.
	WriteChunk(b []byte) error
}

Writer defines the interface which a Chunker uses to write the chunked data.

Directories

Path Synopsis
Package fixed implements a chunker which returns chunks of fixed size (except for the last one).
Package fixed implements a chunker which returns chunks of fixed size (except for the last one).

Jump to

Keyboard shortcuts

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