traversal

package
v0.0.0-...-7de2c07 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0, MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiscoverRoots

func DiscoverRoots(ctx context.Context, incoming <-chan cid.Cid, ls *linking.LinkSystem) ([]cid.Cid, error)

DiscoverRoots scans all keys in a store and finds UnixFS roots among them

func IterateDirLinks(ctx context.Context, root cid.Cid, substrate dagpb.PBNode, data data.UnixFSData, lsys *ipld.LinkSystem, visitor UnixFSVisitor) error
func IterateFileLinks(ctx context.Context, root cid.Cid, substrate dagpb.PBNode, data data.UnixFSData, lsys *ipld.LinkSystem, visitor UnixFSVisitor) error
func IterateHAMTDirLinks(ctx context.Context, root cid.Cid, substrate dagpb.PBNode, data data.UnixFSData, lsys *ipld.LinkSystem, visitor UnixFSVisitor) error

NewUnixFSHAMTShard attempts to construct a UnixFSHAMTShard node from the base protobuf node plus a decoded UnixFSData structure

func IterateUnixFSNode

func IterateUnixFSNode(ctx context.Context, root cid.Cid, lsys *ipld.LinkSystem, visitor UnixFSVisitor) error

Types

type UnixFSVisitor

type UnixFSVisitor interface {
	OnPath(ctx context.Context, root cid.Cid, path string, cids []cid.Cid) error
	OnFileRange(ctx context.Context, root cid.Cid, cid cid.Cid, depth int, byteMin uint64, byteMax uint64, leaf bool) error
	OnRoot(ctx context.Context, root cid.Cid, kind int64) error
}

func RecursiveVisitor

func RecursiveVisitor(visitor UnixFSVisitor, lsys *ipld.LinkSystem) UnixFSVisitor

Jump to

Keyboard shortcuts

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