importer

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

View Source
const UnixfsChunkSize uint64 = 1 << 20
View Source
const UnixfsLinksPerLevel = 1 << 10

Variables

This section is empty.

Functions

func BalanceNode

func BalanceNode(ctx context.Context, f io.Reader, fsize int64, bufDs format.DAGService, cidBuilder cid.Builder, batchReadNum int) (cid.Cid, error)

Todos:

read more bytes and parallel the dags save work

func NewDagWithData

func NewDagWithData(rd []byte, fsNodeType pb.Data_DataType, cidBuilder cid.Builder) (format.Node, error)

Types

type BatchSplitter

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

func NewBatchSplitter

func NewBatchSplitter(r io.Reader, size int64, batch int) *BatchSplitter

NewSizeSplitter returns a new size-based Splitter with the given block size.

func (*BatchSplitter) NextBytes

func (ss *BatchSplitter) NextBytes() ([]*Idxbuf, error)

func (*BatchSplitter) Reader

func (ss *BatchSplitter) Reader() io.Reader

type FSNodeOverDag

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

func NewFSNFromDag

func NewFSNFromDag(nd *merkledag.ProtoNode) (*FSNodeOverDag, error)

func NewFSNodeOverDag

func NewFSNodeOverDag(fsNodeType pb.Data_DataType, cidBuilder cid.Builder) *FSNodeOverDag

func (*FSNodeOverDag) AddChild

func (n *FSNodeOverDag) AddChild(link *format.Link, fileSize uint64) error

func (*FSNodeOverDag) Commit

func (n *FSNodeOverDag) Commit() (format.Node, error)

func (*FSNodeOverDag) SetFileData

func (n *FSNodeOverDag) SetFileData(fileData []byte)
type IdxLink struct {
	Idx      int
	Link     *format.Link
	FileSize uint64
}

type Idxbuf

type Idxbuf struct {
	Idx int
	Buf []byte
}

Jump to

Keyboard shortcuts

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