Categorygithub.com/ipfs/go-ipld-format
modulepackage
0.6.0
Repository: https://github.com/ipfs/go-ipld-format.git
Documentation: pkg.go.dev

# README

go-ipld-format

Coverage Status Travis CI

go-ipld-format is a set of interfaces that a type needs to implement in order to be a part of the ipld merkle-forest.

Lead Maintainer

Eric Myhre

Table of Contents

Install

make install

Contribute

PRs are welcome!

Small note: If editing the Readme, please conform to the standard-readme specification.

License

MIT © Jeromy Johnson

# Functions

No description provided by the author
Decode decodes the given block using passed DecodeBlockFunc.
ExtractIPLDNode is a helper function that takes a `NavigableNode` and returns the IPLD `Node` wrapped inside.
GetDAG will fill out all of the links of the given Node.
GetLinks returns the CIDs of the children of the given node.
GetNodes returns an array of 'FutureNode' promises, with each corresponding to the key with the same index as the passed in keys.
IsNotFound returns if the given error is or wraps an ErrNotFound (equivalent to errors.Is(err, ErrNotFound{})).
MakeLink creates a link to the given node.
MaxNodesBatchOption sets the maximum number of buffered nodes before writing blocks.
MaxSizeBatchOption sets the maximum amount of buffered data before writing blocks.
NewBatch returns a node buffer (Batch) that buffers nodes internally and commits them to the underlying DAGService in batches.
NewBufferedDAG creates a BufferedDAG using the given DAGService and the given options for the Batch NodeAdder.
NewNavigableIPLDNode returns a `NavigableIPLDNode` wrapping the provided `node`.
NodePromise provides a promise like interface for a dag Node the first call to Get will block until the Node is received from its internal channels, subsequent calls will return the cached node.
NewWalker creates a new `Walker` structure from a `root` NavigableNode.

# Variables

EndOfDag wraps the `errUpOnRoot` and signals to the user that the entire DAG has been iterated.
ErrClosed is returned when operating on a batch that has already been closed.
ErrDownNoChild signals there is no child at `ActiveChildIndex` in the `ActiveNode` to go down to.
ErrNextNoChild signals the end of this parent child nodes.
ErrNilVisitor signals the lack of a `Visitor` function.
ErrNotCommited is returned when closing a batch that hasn't been successfully committed.

# Structs

Batch is a buffer for batching adds to a dag.
BufferedDAG implements DAGService using a Batch NodeAdder to wrap add operations in the given DAGService.
ErrNotFound is used to signal when a Node could not be found.
Link represents an IPFS Merkle DAG Link between Nodes.
NavigableIPLDNode implements the `NavigableNode` interface wrapping an IPLD `Node` and providing support for node promises.
Either a node or an error.
No description provided by the author
NodeStat is a statistics object for a Node.
Registry is a structure for storing mappings of multicodec IPLD codec numbers to DecodeBlockFunc functions.
Walker provides methods to move through a DAG of nodes that implement the `NavigableNode` interface.

# Interfaces

DAGService is an IPFS Merkle DAG service.
NodeGetters can optionally implement this interface to make finding linked objects faster.
NavigableNode is the interface the nodes of a DAG need to implement in order to be traversed by the `Walker`.
Node is the base interface all IPLD nodes must implement.
NodeAdder adds nodes to a DAG.
The basic Node resolution service.
No description provided by the author

# Type aliases

BatchOption provides a way of setting internal options of a Batch.
DecodeBlockFunc functions decode blocks into nodes.
Function called each time a node is arrived upon in a walk operation through the `down` method (not when going back `up`).