Categorygithub.com/ETHFSx/go-merkledag
modulepackage
0.3.3
Repository: https://github.com/ethfsx/go-merkledag.git
Documentation: pkg.go.dev

# README

go-merkledag

Coverage Status Travis CI

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

Lead Maintainer

Steven Allen

Table of Contents

TODO

  • Pull out dag-pb stuff into go-ipld-pb
  • Pull 'raw nodes' out into go-ipld-raw (maybe main one instead)
  • Move most other logic to go-ipld
  • Make dagservice constructor take a 'blockstore' to avoid the blockservice offline nonsense
  • deprecate this package

Contribute

PRs are welcome!

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

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.
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.

# Variables

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 ipld.Links.
WalkOption is a setter for walkOptions.