importer

package
v0.0.0-...-bebc87d Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2014 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BlockSizeLimit = int64(1048576) // 1 MB

BlockSizeLimit specifies the maximum size an imported block can have.

View Source
var ErrSizeLimitExceeded = fmt.Errorf("object size limit exceeded")

ErrSizeLimitExceeded signals that a block is larger than BlockSizeLimit.

Functions

func NewDagFromFile

func NewDagFromFile(fpath string) (*dag.Node, error)

NewDagFromFile constructs a Merkle DAG from the file at given path.

func NewDagFromReader

func NewDagFromReader(r io.Reader) (*dag.Node, error)

NewDagFromReader constructs a Merkle DAG from the given io.Reader. size required for block construction.

func NewDagFromReaderWithSplitter

func NewDagFromReaderWithSplitter(r io.Reader, spl BlockSplitter) (*dag.Node, error)

Types

type BlockSplitter

type BlockSplitter interface {
	Split(io.Reader) chan []byte
}

type MaybeRabin

type MaybeRabin struct {
	MinBlockSize int
	MaxBlockSize int
	// contains filtered or unexported fields
}

func NewMaybeRabin

func NewMaybeRabin(avgBlkSize int) *MaybeRabin

func (*MaybeRabin) Split

func (mr *MaybeRabin) Split(r io.Reader) chan []byte

type SizeSplitter

type SizeSplitter struct {
	Size int
}

func (*SizeSplitter) Split

func (ss *SizeSplitter) Split(r io.Reader) chan []byte

Jump to

Keyboard shortcuts

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