unixfs

package
v0.6.9 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CarBytesLinkSystem added in v0.5.0

func CarBytesLinkSystem(t *testing.T, carReader io.ReaderAt) ipld.LinkSystem

func CompareDirEntries

func CompareDirEntries(t *testing.T, a, b DirEntry)

Types

type DirEntry

type DirEntry struct {
	Path     string
	Content  []byte
	Root     cid.Cid
	SelfCids []cid.Cid
	TSize    uint64
	Children []DirEntry
}

DirEntry represents a flattened directory entry, where Path is from the root of the directory and Content is the file contents. It is intended that a DirEntry slice can be used to represent a full-depth directory without needing nesting.

func BuildDirectory added in v0.5.0

func BuildDirectory(t *testing.T, linkSys *linking.LinkSystem, children []DirEntry, sharded bool) DirEntry

func CarToDirEntry added in v0.5.0

func CarToDirEntry(t *testing.T, carReader io.ReaderAt, root cid.Cid, expectFull bool) DirEntry

func GenerateDirectory

func GenerateDirectory(t *testing.T, linkSys *linking.LinkSystem, randReader io.Reader, targetSize int, rootSharded bool) DirEntry

func GenerateDirectoryFrom added in v0.5.0

func GenerateDirectoryFrom(t *testing.T,
	linkSys *linking.LinkSystem,
	randReader io.Reader,
	targetSize int,
	dir string,
	sharded bool,
) DirEntry

func GenerateFile

func GenerateFile(t *testing.T, linkSys *linking.LinkSystem, randReader io.Reader, size int) DirEntry

func ToDirEntry

func ToDirEntry(t *testing.T, linkSys linking.LinkSystem, rootCid cid.Cid, expectFull bool) DirEntry
func (de DirEntry) Link() ipld.Link

func (DirEntry) Size added in v0.5.0

func (de DirEntry) Size() (int64, error)

Jump to

Keyboard shortcuts

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