Documentation ¶
Index ¶
- type ChunkHandler
- type Chunker
- type ContentDefined
- func (c *ContentDefined) Buffered() int
- func (c *ContentDefined) Flush() error
- func (c *ContentDefined) MaxSize() int
- func (c *ContentDefined) MeanSize() int
- func (c *ContentDefined) MinSize() int
- func (c *ContentDefined) ReadFrom(r io.Reader) (int64, error)
- func (c *ContentDefined) Reset()
- func (c *ContentDefined) Write(data []byte) (int, error)
- func (c *ContentDefined) WriteByte(b byte) error
- type Exponential
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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, key *[32]byte, onChunk func(data []byte) error) *ContentDefined
NewContentDefined creates a new content defined chunker. key must not be nil. Use new([32]byte) to give a key of all zeros.
func (*ContentDefined) Buffered ¶
func (c *ContentDefined) Buffered() int
func (*ContentDefined) Flush ¶
func (c *ContentDefined) Flush() error
func (*ContentDefined) MaxSize ¶ added in v0.0.4
func (c *ContentDefined) MaxSize() int
func (*ContentDefined) MeanSize ¶ added in v0.0.4
func (c *ContentDefined) MeanSize() int
func (*ContentDefined) MinSize ¶ added in v0.0.4
func (c *ContentDefined) MinSize() int
func (*ContentDefined) ReadFrom ¶ added in v0.0.3
func (c *ContentDefined) ReadFrom(r io.Reader) (int64, 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.