unixfile

package
v0.4.10 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2019 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAndSplitMetadata added in v0.4.9

func CheckAndSplitMetadata(ctx context.Context, nd ipld.Node, ds ipld.DAGService, meta bool) (ipld.Node, ipld.Node, error)

checkAndSplitMetadata returns both data root node and metadata root node if exists from the DAG topped by the given 'nd'. Case #1: if 'nd' is dummy root with metadata root node and user data root node being children

return the second child node that is the root of user data sub-DAG.

Case #2: if 'nd' is metadata and the given `meta` is true, return nd. Otherwise return error. Case #3: if 'nd' is user data, return 'nd'.

func NewUnixfsFile

func NewUnixfsFile(ctx context.Context, dserv ipld.DAGService, nd ipld.Node, meta bool) (files.Node, error)

NewUnixFsFile returns a DagReader for the 'nd' root node. If meta = true, only return a valid metadata node if it exists. If not, return error. If meta = false, return only the data contents.

Types

This section is empty.

Jump to

Keyboard shortcuts

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