Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DerivePolynomial ¶
func DerivePolynomial(rng io.Reader) rabinkarp64.Pol
Types ¶
type ChunkHandler ¶
ChunkHandler is the type of the function called to recieve chunks. the buffer should not be used outside of the function call.
type Chunker ¶
type Chunker interface {
// Write writes bytes to the chunker, chunks can be produced anywhere in the slice
Write(p []byte) (int, error)
// Buffered returns the number of bytes buffered, but not yet made into a chunk.
Buffered() int
// Flush forces the production of a chunk, if there is any buffered data.
Flush() error
}
Chunker is the common interface exposed by chunkers
type ContentDefined ¶
type ContentDefined struct {
// contains filtered or unexported fields
}
func NewContentDefined ¶
func NewContentDefined(minSize, avgSize, maxSize int, pol rabinkarp64.Pol, onChunk func(data []byte) error) *ContentDefined
func (*ContentDefined) Buffered ¶
func (c *ContentDefined) Buffered() int
func (*ContentDefined) Flush ¶
func (c *ContentDefined) Flush() error
func (*ContentDefined) Reset ¶
func (c *ContentDefined) Reset()
func (*ContentDefined) WriteByte ¶
func (c *ContentDefined) WriteByte(b byte) error
type Exponential ¶
type Exponential struct {
// contains filtered or unexported fields
}
func NewExponential ¶
func NewExponential(minSize, maxSize, period int, fn ChunkHandler) *Exponential
func (*Exponential) Buffered ¶
func (e *Exponential) Buffered() int
func (*Exponential) Flush ¶
func (e *Exponential) Flush() error
func (*Exponential) Reset ¶
func (e *Exponential) Reset()
Click to show internal directories.
Click to hide internal directories.