Documentation ¶
Overview ¶
package importer implements utilities used to create ipfs DAGs from files and readers
Index ¶
- Variables
- func BuildDagFromFile(fpath string, ds dag.DAGService, mp pin.ManualPinner) (*dag.Node, error)
- func BuildDagFromReader(r io.Reader, ds dag.DAGService, mp pin.ManualPinner, spl chunk.BlockSplitter) (*dag.Node, error)
- func NewDagFromFile(fpath string) (*dag.Node, error)
- func NewDagFromReader(r io.Reader) (*dag.Node, error)
- func NewDagFromReaderWithSplitter(r io.Reader, spl chunk.BlockSplitter) (*dag.Node, error)
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 BuildDagFromFile ¶
func BuildDagFromFile(fpath string, ds dag.DAGService, mp pin.ManualPinner) (*dag.Node, error)
Builds a DAG from the given file, writing created blocks to disk as they are created
func BuildDagFromReader ¶
func BuildDagFromReader(r io.Reader, ds dag.DAGService, mp pin.ManualPinner, spl chunk.BlockSplitter) (*dag.Node, error)
Builds a DAG from the data in the given reader, writing created blocks to disk as they are created
func NewDagFromFile ¶
NewDagFromFile constructs a Merkle DAG from the file at given path.
func NewDagFromReader ¶
NewDagFromReader constructs a Merkle DAG from the given io.Reader. size required for block construction.
func NewDagFromReaderWithSplitter ¶
Creates an in memory DAG from data in the given reader
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.