Documentation ¶
Index ¶
- Constants
- func BalanceNode(ctx context.Context, f io.Reader, fsize int64, bufDs format.DAGService, ...) (cid.Cid, error)
- func NewDagWithData(rd []byte, fsNodeType pb.Data_DataType, cidBuilder cid.Builder) (format.Node, error)
- type BatchSplitter
- type CommonAPI
- type DagAPI
- func (a *DagAPI) DagExport(ctx context.Context, c cid.Cid, path string, pad bool, batchNum int, ...) (chan api.PBar, error)
- func (a *DagAPI) DagHas(ctx context.Context, cid cid.Cid) (bool, error)
- func (a *DagAPI) DagImport(ctx context.Context, targetPath string) (chan api.PBar, error)
- func (a *DagAPI) DagStat(ctx context.Context, cid cid.Cid, timeout uint) (*format.NodeStat, error)
- func (a *DagAPI) DagSync(ctx context.Context, cids []cid.Cid, concur int) (chan string, error)
- type FSNodeOverDag
- type FullNodeAPI
- type IdxLink
- type Idxbuf
- type NetAPI
- func (a *NetAPI) ID(context.Context) (peer.ID, error)
- func (a *NetAPI) NetAddrsListen(context.Context) (peer.AddrInfo, error)
- func (a *NetAPI) NetConnect(ctx context.Context, p peer.AddrInfo) error
- func (a *NetAPI) NetConnectedness(ctx context.Context, pid peer.ID) (network.Connectedness, error)
- func (a *NetAPI) NetDisconnect(ctx context.Context, p peer.ID) error
- func (a *NetAPI) NetPeers(context.Context) ([]peer.AddrInfo, error)
Constants ¶
View Source
const UnixfsChunkSize uint64 = 1 << 20
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 ¶
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)
NextBytes produces a new chunk.
func (*BatchSplitter) Reader ¶
func (ss *BatchSplitter) Reader() io.Reader
Reader returns the io.Reader associated to this Splitter.
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) SetFileData ¶
func (n *FSNodeOverDag) SetFileData(fileData []byte)
type FullNodeAPI ¶
Click to show internal directories.
Click to hide internal directories.