util

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2022 License: MIT Imports: 30 Imported by: 2

Documentation

Index

Constants

View Source
const BufSize = (4 << 20) / 128 * 127
View Source
const UnixfsChunkSize uint64 = 1 << 20
View Source
const UnixfsLinksPerLevel = 1 << 10

Variables

This section is empty.

Functions

func BuildFileNode

func BuildFileNode(item Finfo, bufDs ipld.DAGService, cidBuilder cid.Builder) (node ipld.Node, err error)

func CalculateCommpHashHash

func CalculateCommpHashHash(reader io.Reader, PadPieceSize uint64) (commCid cid.Cid, pieceSize uint64, err error)

Types

type CarHeader

type CarHeader struct {
	Roots   []cid.Cid
	Version uint64
}

type FSBuilder

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

func NewFSBuilder

func NewFSBuilder(root *dag.ProtoNode, ds ipld.DAGService) *FSBuilder

func (*FSBuilder) Build

func (b *FSBuilder) Build() (rootn *FsNode, err error)

type Finfo

type Finfo struct {
	Path  string
	Size  int64
	Start int64
	End   int64
}

type FsNode

type FsNode struct {
	Name string
	Hash string
	Size uint64
	Link []FsNode
}

func GenerateCar

func GenerateCar(ctx context.Context, fileList []Finfo, parentPath string, output io.Writer) (ipldDag *FsNode, cid string, err error)

Jump to

Keyboard shortcuts

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