block

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: Apache-2.0, MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseQuery

func ParseQuery(spec string) (
	root cid.Cid,
	path datamodel.Path,
	scope trustlessutils.DagScope,
	duplicates bool,
	byteRange *trustlessutils.ByteRange,
	err error,
)

func PrintableQuery

func PrintableQuery(c cid.Cid, path datamodel.Path, scope trustlessutils.DagScope, byteRange *trustlessutils.ByteRange, duplicates bool) string

func WritingVisitor

func WritingVisitor(w io.Writer, duplicates, fullPath bool) func(p datamodel.Path, depth int, blk Block)

Types

type Block

type Block struct {
	Cid        cid.Cid
	IpldPath   datamodel.Path
	UnixfsPath datamodel.Path
	DataType   int64 // go-unixfsnode/data.Data_*
	Children   []Child
	ByteOffset int64
	ByteSize   int64
	Arity      int64   // for sharded nodes
	FieldData  []byte  // bitfield data for sharded nodes
	BlockSizes []int64 // for sharded files
	ShardIndex string
	// contains filtered or unexported fields
}

func NewBlock

func NewBlock(ls linking.LinkSystem, c cid.Cid) (Block, error)

func NewBlockWith

func NewBlockWith(
	ls linking.LinkSystem,
	c cid.Cid,
	ipldPath,
	unixfsPath datamodel.Path,
	byteOffset int64,
	shardIndex string,
) (Block, error)

func (Block) DataTypeString

func (b Block) DataTypeString() string

func (Block) Length

func (b Block) Length() int64

func (Block) Navigate

func (b Block) Navigate(
	path datamodel.Path,
	scope trustlessutils.DagScope,
	bytes trustlessutils.ByteRange,
	ignoreMissing bool,
	visitFn func(p datamodel.Path, depth int, b Block),
) error

type Child

type Child struct {
	Cid        cid.Cid
	IpldPath   datamodel.Path
	UnixfsPath datamodel.Path
	ByteOffset int64
	ShardIndex string
	// contains filtered or unexported fields
}

func (*Child) Block

func (c *Child) Block() (Block, error)

Jump to

Keyboard shortcuts

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