go-unixfs: github.com/ipfs/go-unixfs/importer/trickle Index | Files

package trickle

import "github.com/ipfs/go-unixfs/importer/trickle"

Package trickle allows to build trickle DAGs. In this type of DAG, non-leave nodes are first filled with data leaves, and then incorporate "layers" of subtrees as additional links.

Each layer is a trickle sub-tree and is limited by an increasing maximum depth. Thus, the nodes first layer can only hold leaves (depth 1) but subsequent layers can grow deeper. By default, this module places 4 nodes per layer (that is, 4 subtrees of the same maximum depth before increasing it).

Trickle DAGs are very good for sequentially reading data, as the first data leaves are directly reachable from the root and those coming next are always nearby. They are suited for things like streaming applications.

Index

Package Files

trickledag.go

func Append Uses

func Append(ctx context.Context, basen ipld.Node, db *h.DagBuilderHelper) (out ipld.Node, errOut error)

Append appends the data in `db` to the dag, using the Trickledag format

func Layout Uses

func Layout(db *h.DagBuilderHelper) (ipld.Node, error)

Layout builds a new DAG with the trickle format using the provided DagBuilderHelper. See the module's description for a more detailed explanation.

func VerifyTrickleDagStructure Uses

func VerifyTrickleDagStructure(nd ipld.Node, p VerifyParams) error

VerifyTrickleDagStructure checks that the given dag matches exactly the trickle dag datastructure layout

type VerifyParams Uses

type VerifyParams struct {
    Getter      ipld.NodeGetter
    Direct      int
    LayerRepeat int
    Prefix      *cid.Prefix
    RawLeaves   bool
}

VerifyParams is used by VerifyTrickleDagStructure

Package trickle imports 8 packages (graph) and is imported by 18 packages. Updated 2019-02-16. Refresh now. Tools for package owners.