dag

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: Apache-2.0, MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DAG

type DAG struct {
	// contains filtered or unexported fields
}

DAG is a service for accessing the merkledag

func NewDAG

func NewDAG(dserv ipld.DAGService) *DAG

NewDAG creates a DAG with a given DAGService

func (*DAG) Cat

func (dag *DAG) Cat(ctx context.Context, c cid.Cid) (uio.DagReader, error)

Cat returns an iostream with a piece of data stored on the merkeldag with the given cid.

TODO: this goes back to 'how is data stored and referenced' For now, lets just do things the ipfs way. https://github.com/filecoin-project/specs/issues/136

func (*DAG) GetFileSize

func (dag *DAG) GetFileSize(ctx context.Context, c cid.Cid) (uint64, error)

GetFileSize returns the file size for a given Cid

func (*DAG) GetNode

func (dag *DAG) GetNode(ctx context.Context, ref string) (interface{}, error)

GetNode returns the associated DAG node for the passed in CID.

func (*DAG) ImportData

func (dag *DAG) ImportData(ctx context.Context, data io.Reader) (ipld.Node, error)

ImportData adds data from an io stream to the merkledag and returns the Cid of the given data

func (*DAG) RecursiveGet

func (dag *DAG) RecursiveGet(ctx context.Context, c cid.Cid) ([]ipld.Node, error)

RecursiveGet will walk the dag in order (depth first) starting at the given root `c`.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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