pack

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 26, 2023 License: MIT Imports: 29 Imported by: 1

Documentation

Index

Constants

View Source
const ChunkSize int64 = 1 << 20
View Source
const NumLinkPerNode = 1024

Variables

View Source
var EmptyBlockCID = cid.NewCidV1(cid.Raw, util.Hash([]byte{}))

Functions

func AssembleItem

func AssembleItem(links []Link) ([]blocks.Block, *merkledag.ProtoNode, error)

func GetPathWithMostSpace

func GetPathWithMostSpace(paths []string) (string, error)

func Min

func Min(i int, i2 int) int

func WriteCarBlock

func WriteCarBlock(writer io.Writer, block blocks.Block) (int64, error)

Types

type BlockResult

type BlockResult struct {
	CID    cid.Cid
	Offset int64
	Raw    []byte
	Error  error
}
type Link struct {
	format.Link
	ChunkSize uint64
}

type Result

type Result struct {
	CarFilePath string
	CarFileSize int64
	PieceCID    cid.Cid
	PieceSize   int64
	RootCID     cid.Cid
	Header      []byte
	CarBlocks   []model.CarBlock
	ItemCIDs    map[uint64]cid.Cid
	Objects     []fs.Object
}

func ProcessItems

func ProcessItems(
	ctx context.Context,
	handler datasource.Handler,
	items []model.Item,
	outDir string,
	pieceSize int64,
	recipients []string,
) (*Result, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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