Categorygithub.com/ipfs/go-merkledag
modulepackage
0.11.0
Repository: https://github.com/ipfs/go-merkledag.git
Documentation: pkg.go.dev

# README

go-merkledag

Coverage Status

go-merkledag implements the 'DAGService' interface and adds two ipld node types, Protobuf and Raw

Status

❗ This library is maintained, but not actively developed. It will continue to receive fixes and security updates for users that depend on it. However, it may be deprecated in the future and it is recommended that you use alternatives to the functionality in go-merkledag, including:

License

MIT © Juan Batiz-Benet

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
Package traverse provides merkledag traversal functions.

# Functions

Concurrency is a WalkOption indicating that node fetching should be done in parallel, with a specific concurrency factor.
Concurrent is a WalkOption indicating that node fetching should be done in parallel, with the default concurrency factor.
DecodeProtobuf decodes raw data and returns a new Node instance.
DecodeProtobufBlock is a block decoder for protobuf IPLD nodes conforming to node.DecodeBlockFunc.
DecodeRawBlock is a block decoder for raw IPLD nodes conforming to `node.DecodeBlockFunc`.
FetchGraph fetches all nodes that are children of the given node.
FetchGraphWithDepthLimit fetches all nodes that are children to the given node down to the given depth.
GetLinksDirect creates a function to get the links for a node, from the node, bypassing the LinkService.
GetLinksWithDAG returns a GetLinks function that tries to use the given NodeGetter as a LinkGetter to get the children of a given IPLD node.
IgnoreErrors is a WalkOption indicating that the walk should attempt to continue even when an error occur.
IgnoreMissing is a WalkOption indicating that the walk should continue when a node is missing.
NewDAGService constructs a new DAGService (using the default implementation).
NewRawNode creates a RawNode using the default sha2-256 hash function.
NewRawNodeWPrefix creates a RawNode using the provided cid builder.
NewReadOnlyDagService takes a NodeGetter, and returns a full DAGService implementation that returns ErrReadOnly when its 'write' methods are invoked.
NewSession returns a session backed NodeGetter if the given NodeGetter implements SessionMaker.
NodeWithData builds a new Protonode with the given data.
OnError is a WalkOption adding a custom error handler.
OnMissing is a WalkOption adding a callback that will be triggered on a missing node.
PrefixForCidVersion returns the Protobuf prefix for a given CID version.
No description provided by the author
No description provided by the author
SkipRoot is a WalkOption indicating that the root node should skipped.
V0CidPrefix returns a prefix for CIDv0.
V1CidPrefix returns a prefix for CIDv1 with the default settings.
WalkGraph will walk the dag in order (depth first) starting at the given root.
WalkDepth walks the dag starting at the given root and passes the current depth to a given visit function.
WrapSession wraps a blockservice session to satisfy the format.NodeGetter interface.

# Variables

Common errors.
Common errors.
Common errors.
ErrReadOnly is used when a read-only datastructure is written to.

# Structs

ComboService implements ipld.DAGService, using 'Read' for all fetch methods, and 'Write' for all methods that add new objects.
ErrorService implements ipld.DAGService, returning 'Err' for every call.
ProgressTracker is used to show progress when fetching nodes.
ProtoNode represents a node in the IPFS Merkle DAG.
RawNode represents a node which only contains data.

# Interfaces

SessionMaker is an object that can generate a new fetching session.

# Type aliases

GetLinks is the type of function passed to the EnumerateChildren function(s) for getting the children of an IPLD node.
LinkSlice is a slice of format.Links.
WalkOption is a setter for walkOptions.