util

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: MIT Imports: 33 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(ctx context.Context, 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 CidMapValue added in v1.3.0

type CidMapValue struct {
	IsDir bool
	Cid   string
}

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, tmpDir string, output io.Writer) (ipldDag *FsNode, cid string, cidMap map[string]CidMapValue, err error)

Jump to

Keyboard shortcuts

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