Documentation ¶
Index ¶
Constants ¶
View Source
const FilecoinPrecision = uint64(1_000_000_000_000_000_000)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CandidateRetriever ¶ added in v0.3.0
type CandidateRetriever func(ctx context.Context, request RetrievalRequest, candidates []RetrievalCandidate, events func(RetrievalEvent)) (*RetrievalStats, error)
type EventCode ¶ added in v0.3.0
type EventCode string
const ( CandidatesFoundCode EventCode = "candidates-found" CandidatesFilteredCode EventCode = "candidates-filtered" StartedCode EventCode = "started" ConnectedCode EventCode = "connected" QueryAskedCode EventCode = "query-asked" QueryAskedFilteredCode EventCode = "query-asked-filtered" ProposedCode EventCode = "proposed" AcceptedCode EventCode = "accepted" FirstByteCode EventCode = "first-byte-received" FailedCode EventCode = "failure" SuccessCode EventCode = "success" )
type FIL ¶
type FIL gostatetypesbig.Int
type Phase ¶ added in v0.3.0
type Phase string
const ( // IndexerPhase involves a candidates-found|failure IndexerPhase Phase = "indexer" // QueryPhase involves a connect, query-asked|failure QueryPhase Phase = "query" // RetrievalPhase involves the full data retrieval: connect, proposed, accepted, first-byte-received, success|failure RetrievalPhase Phase = "retrieval" )
type RetrievalCandidate ¶ added in v0.3.0
func NewRetrievalCandidate ¶ added in v0.3.0
func NewRetrievalCandidate(pid peer.ID, rootCid cid.Cid) RetrievalCandidate
type RetrievalCandidateFinder ¶ added in v0.3.0
type RetrievalCandidateFinder func(ctx context.Context, request RetrievalRequest, events func(RetrievalEvent)) ([]RetrievalCandidate, error)
type RetrievalEvent ¶ added in v0.3.0
type RetrievalEvent interface { // Time returns the time that the event occurred Time() time.Time // RetrievalId returns the unique ID for this retrieval RetrievalId() RetrievalID // Code returns the type of event this is Code() EventCode // Phase returns what phase of a retrieval this even occurred on Phase() Phase // PhaseStartTime returns the time that the phase started for this storage provider PhaseStartTime() time.Time // PayloadCid returns the CID being requested PayloadCid() cid.Cid // StorageProviderId returns the peer ID of the storage provider if this // retrieval was requested via peer ID StorageProviderId() peer.ID }
type RetrievalEventSubscriber ¶ added in v0.3.0
type RetrievalEventSubscriber func(event RetrievalEvent)
RetrievalEventSubscriber is a function that receives a stream of retrieval events from all retrievals that are in progress. Various different types implement the RetrievalEvent interface and may contain additionl information about the event beyond what is available on the RetrievalEvent interface.
type RetrievalID ¶ added in v0.3.0
func NewRetrievalID ¶ added in v0.3.0
func NewRetrievalID() (RetrievalID, error)
func (RetrievalID) MarshalText ¶ added in v0.3.0
func (id RetrievalID) MarshalText() ([]byte, error)
func (RetrievalID) String ¶ added in v0.3.0
func (id RetrievalID) String() string
func (*RetrievalID) UnmarshalText ¶ added in v0.3.0
func (id *RetrievalID) UnmarshalText(data []byte) error
type RetrievalRequest ¶ added in v0.3.0
type RetrievalRequest struct { RetrievalID RetrievalID Cid cid.Cid LinkSystem ipld.LinkSystem }
RetrievalRequest is the top level parameters for a request -- this should be left unchanged as you move down a retriever tree
type RetrievalStats ¶ added in v0.3.0
type Retriever ¶ added in v0.3.0
type Retriever func(ctx context.Context, request RetrievalRequest, events func(RetrievalEvent)) (*RetrievalStats, error)
func WithCandidates ¶ added in v0.3.0
func WithCandidates(retrievalCandidateFinder RetrievalCandidateFinder, childRetriever CandidateRetriever) Retriever
Click to show internal directories.
Click to hide internal directories.