Documentation ¶
Index ¶
- func GeneratePieceCIDFromFile(proofType abi.RegisteredSealProof, piece io.Reader, ...) (cid.Cid, error)
- func GeneratePieceCommitment(rt abi.RegisteredSealProof, rd io.Reader, pieceSize uint64) (cid.Cid, abi.UnpaddedPieceSize, error)
- func ToReadableFile(r io.Reader, n int64) (*os.File, func() error, error)
- type CarIO
- type MultiStore
- type PieceIO
- type PreparedCar
- type ReadStore
- type WriteStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GeneratePieceCIDFromFile ¶ added in v0.6.0
func GeneratePieceCIDFromFile(proofType abi.RegisteredSealProof, piece io.Reader, pieceSize abi.UnpaddedPieceSize) (cid.Cid, error)
func GeneratePieceCommitment ¶
func GeneratePieceCommitment(rt abi.RegisteredSealProof, rd io.Reader, pieceSize uint64) (cid.Cid, abi.UnpaddedPieceSize, error)
Types ¶
type CarIO ¶
type CarIO interface { // WriteCar writes a given payload to a CAR file and into the passed IO stream WriteCar(ctx context.Context, bs ReadStore, payloadCid cid.Cid, node ipld.Node, w io.Writer, userOnNewCarBlocks ...car.OnNewCarBlockFunc) error // PrepareCar prepares a car so that its total size can be calculated without writing it to a file. // It can then be written with PreparedCar.Dump PrepareCar(ctx context.Context, bs ReadStore, payloadCid cid.Cid, node ipld.Node, userOnNewCarBlocks ...car.OnNewCarBlockFunc) (PreparedCar, error) // LoadCar loads blocks into the a store from a given CAR file LoadCar(bs WriteStore, r io.Reader) (cid.Cid, error) }
type MultiStore ¶ added in v0.5.2
type MultiStore interface {
Get(i multistore.StoreID) (*multistore.Store, error)
}
type PieceIO ¶
type PieceIO interface { GeneratePieceReader(payloadCid cid.Cid, selector ipld.Node, storeID *multistore.StoreID, userOnNewCarBlocks ...car.OnNewCarBlockFunc) (io.ReadCloser, uint64, error, <-chan error) GeneratePieceCommitment(rt abi.RegisteredSealProof, payloadCid cid.Cid, selector ipld.Node, storeID *multistore.StoreID, userOnNewCarBlocks ...car.OnNewCarBlockFunc) (cid.Cid, abi.UnpaddedPieceSize, error) ReadPiece(storeID *multistore.StoreID, r io.Reader) (cid.Cid, error) }
PieceIO converts between payloads and pieces
func NewPieceIO ¶
func NewPieceIO(carIO CarIO, bs blockstore.Blockstore, multiStore MultiStore) PieceIO
type WriteStore ¶
Click to show internal directories.
Click to hide internal directories.