Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var CIDInfoUndefined = CIDInfo{}
CIDInfoUndefined is cid info with no information
var DSCIDPrefix = "/cid-infos"
DSCIDPrefix is the name space for storing CID infos
var DSPiecePrefix = "/pieces"
DSPiecePrefix is the name space for storing piece infos
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 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 { 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) }
PieceStore is a saved database of piece info that can be modified and queried
func NewPieceStore ¶
func NewPieceStore(ds datastore.Batching) PieceStore
NewPieceStore returns a new piecestore based on the given datastore