blockrecorder

package
v1.2.12 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: Apache-2.0, MIT Imports: 8 Imported by: 0

Documentation

Overview

Package blockrecorder provides utilits to record locations of CIDs to a temporary metadata file, since writing a CAR happens BEFORE we actually hand off for sealing. The metadata file is later used to populate the PieceStore

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RecordEachBlockTo

func RecordEachBlockTo(out io.Writer) car.OnNewCarBlockFunc

RecordEachBlockTo returns a OnNewCarBlockFunc that records the exact location of a given block's data in a CAR file, and writes that data to the given writer

Types

type PieceBlockMetadata

type PieceBlockMetadata struct {
	CID    cid.Cid
	Offset uint64
	Size   uint64
}

PieceBlockMetadata is a record of where a given CID lives in a piece, in terms of its offset and size

func ReadBlockMetadata

func ReadBlockMetadata(input io.Reader) ([]PieceBlockMetadata, error)

ReadBlockMetadata reads previously recorded block metadata

func (*PieceBlockMetadata) MarshalCBOR

func (t *PieceBlockMetadata) MarshalCBOR(w io.Writer) error

func (*PieceBlockMetadata) UnmarshalCBOR

func (t *PieceBlockMetadata) UnmarshalCBOR(r io.Reader) error

Jump to

Keyboard shortcuts

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