dag

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2021 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultChunker = "buzhash"

DefaultChunker is the name of the default chunker algorithm.

Variables

This section is empty.

Functions

func Chunk

func Chunk(ctx context.Context, dag ipld.DAGService, reader io.Reader) (ipld.Node, error)

Chunk splits the given reader into chunks and arranges them into a dag node.

func Diff

func Diff(ctx context.Context, ds ipld.DAGService, before, after ipld.Node) (map[string]dagutils.ChangeType, error)

Diff returns a flattened map of changes between before and after.

func IsAncestor

func IsAncestor(ctx context.Context, ds ipld.NodeGetter, parent, child cid.Cid) (bool, error)

IsAncestor returns true if child is an ancestor of parent.

func ReadCar

func ReadCar(bs blockstore.Blockstore, r io.Reader) (cid.Cid, error)

ReadCar reads the car into the given dag and returns the root cid.

func Status

func Status(ctx context.Context, ds ipld.DAGService, tree ipld.Node, id cid.Cid) (map[string]dagutils.ChangeType, error)

Status returns the changes between the given tree and commit with id.

func Walk

func Walk(ctx context.Context, ds ipld.NodeGetter, id cid.Cid, visit func(cid.Cid) bool) error

Walk performs a depth first traversal of parent commits starting at the given id.

func WriteCar

func WriteCar(ctx context.Context, ds ipld.NodeGetter, head cid.Cid, refs *cid.Set, w io.Writer) error

WriteCar writes the dag into the given writer starting at head and stopping at refs.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL