chunk

package
v0.0.0-...-795e242 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2015 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

package chunk implements streaming block splitters

Index

Constants

This section is empty.

Variables

View Source
var DefaultBlockSize int64 = 1024 * 256
View Source
var IpfsRabinPoly = chunker.Pol(17437180132763653)

Functions

func Chan

func Chan(s Splitter) (<-chan []byte, <-chan error)

Types

type Rabin

type Rabin struct {
	// contains filtered or unexported fields
}

func NewRabin

func NewRabin(r io.Reader, avgBlkSize uint64) *Rabin

func NewRabinMinMax

func NewRabinMinMax(r io.Reader, min, avg, max uint64) *Rabin

func (*Rabin) NextBytes

func (r *Rabin) NextBytes() ([]byte, error)

type Splitter

type Splitter interface {
	NextBytes() ([]byte, error)
}

func DefaultSplitter

func DefaultSplitter(r io.Reader) Splitter

func FromString

func FromString(r io.Reader, chunker string) (Splitter, error)

func NewSizeSplitter

func NewSizeSplitter(r io.Reader, size int64) Splitter

type SplitterGen

type SplitterGen func(r io.Reader) Splitter

func SizeSplitterGen

func SizeSplitterGen(size int64) SplitterGen

Jump to

Keyboard shortcuts

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