unixfile

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2019 License: MIT Imports: 18 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ReedSolomonDagOff   = 0
	ReedSolomonDagOpen  = 1
	ReedSolomonDagNext  = 2
	ReedSolomonDagClose = 3
)

Variables

This section is empty.

Functions

func GetRsNode added in v0.5.2

func GetRsNode(l interface{}) (uio.Node, error)

func InitDag added in v0.5.2

func InitDag(ctx context.Context, dataBuf *bytes.Buffer, cid string) context.Context

func NewReedSolomonDirectory added in v0.5.2

func NewReedSolomonDirectory(ctx context.Context, root ipld.Node, dataNode ipld.Node, dserv ipld.DAGService, opts UnixfsFileOptions,
	metaStruct *MetadataStruct) (files.Node, error)

NewReedSolomonDirectory returns files.Node for the root DAG node of a BTFS object in Reed-Solomon encoding. This builder function is supposed to be called only one time for `btfs get` for a BTFS merkle DAG.

func NewReedSolomonFileUnderDirectory added in v0.5.2

func NewReedSolomonFileUnderDirectory(ctx context.Context, dserv ipld.DAGService, cid string, nd uio.Node) (files.Node, error)

NewReedSolomonFileUnderDirectory returns a files.Node for the given `nd` Node. This functioon is called within the context of Reed-Solomon DAG for directory. The given `nd` is a uio.FileNode and is used to create a reader.

func NewReedSolomonStandaloneFile added in v0.5.2

func NewReedSolomonStandaloneFile(ctx context.Context, root ipld.Node, dataNode ipld.Node, dserv ipld.DAGService, opts UnixfsFileOptions,
	metaStruct *MetadataStruct) (files.Node, error)

func NewReedSolomonSubDirectory added in v0.5.2

func NewReedSolomonSubDirectory(ctx context.Context, dserv ipld.DAGService, cid string, nd uio.Node) (files.Node, error)

NewReedSolomonSugDirectory creates and returns a files.Dir with the given uio.Node.

func NewUnixfsFile

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

NewUnixFsFile returns a DagReader for the 'nd' root node. If opts.Meta = true, only return a valid metadata node if it exists. If not, return error. If opts.Meta = false, return only the data contents. If opts.Meta = false && opts.RepairShards != nil, the shards would be reconstructed and added on this node.

Types

type MetadataStruct added in v0.5.2

type MetadataStruct struct {
	Buff    []byte
	RsMeta  *chunker.RsMetaMap
	DirRoot *uio.DirNode
}

func ObtainMetadataFromDag added in v0.5.2

func ObtainMetadataFromDag(ctx context.Context, metaNode ipld.Node, dserv ipld.NodeGetter) (*MetadataStruct, error)

ObtainMetadataFromDag returns MetadataStruct object.

type ReedSolomonDag added in v0.5.2

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

func GetDag added in v0.5.2

func GetDag(ctx context.Context, cid string) *ReedSolomonDag

func NewReedSolomonDag added in v0.5.2

func NewReedSolomonDag(dataBuf *bytes.Buffer, cid string) *ReedSolomonDag

type UnixfsFileOptions added in v0.5.1

type UnixfsFileOptions struct {
	Meta         bool
	RepairShards []cid.Cid
}

Jump to

Keyboard shortcuts

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