Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CIDInfoUndefined = CIDInfo{}
CIDInfoUndefined is cid info with no information
var PieceInfoUndefined = PieceInfo{}
PieceInfoUndefined is piece info with no information
Functions ¶
This section is empty.
Types ¶
type BlockLocation ¶
BlockLocation is information about where a given block is relative to the overall piece
func (*BlockLocation) MarshalCBOR ¶
func (t *BlockLocation) MarshalCBOR(w io.Writer) error
func (*BlockLocation) UnmarshalCBOR ¶
func (t *BlockLocation) UnmarshalCBOR(r io.Reader) error
type CIDInfo ¶
type CIDInfo struct { CID cid.Cid PieceBlockLocations []PieceBlockLocation }
CIDInfo is information about where a given CID will live inside a piece
type DealInfo ¶
type DealInfo struct { DealID abi.DealID SectorID abi.SectorNumber Offset abi.PaddedPieceSize Length abi.PaddedPieceSize }
DealInfo is information about a single deal for a given piece
type PieceBlockLocation ¶
type PieceBlockLocation struct { BlockLocation PieceCID cid.Cid }
PieceBlockLocation is block information along with the pieceCID of the piece the block is inside of
func (*PieceBlockLocation) MarshalCBOR ¶
func (t *PieceBlockLocation) MarshalCBOR(w io.Writer) error
func (*PieceBlockLocation) UnmarshalCBOR ¶
func (t *PieceBlockLocation) UnmarshalCBOR(r io.Reader) error
type PieceInfo ¶
type PieceInfo struct { PieceCID cid.Cid Deals []DealInfo }
PieceInfo is metadata about a piece a provider may be storing based on its PieceCID -- so that, given a pieceCID during retrieval, the miner can determine how to unseal it if needed
type PieceStore ¶
type PieceStore interface { Start(ctx context.Context) error OnReady(ready shared.ReadyFunc) AddDealForPiece(pieceCID cid.Cid, dealInfo DealInfo) error AddPieceBlockLocations(pieceCID cid.Cid, blockLocations map[cid.Cid]BlockLocation) error GetPieceInfo(pieceCID cid.Cid) (PieceInfo, error) GetCIDInfo(payloadCID cid.Cid) (CIDInfo, error) ListCidInfoKeys() ([]cid.Cid, error) ListPieceInfoKeys() ([]cid.Cid, error) }
PieceStore is a saved database of piece info that can be modified and queried