Documentation ¶
Index ¶
- type LinkTracker
- func (lt *LinkTracker) BlockRefCount(link ipld.Link) int
- func (lt *LinkTracker) Empty() bool
- func (lt *LinkTracker) FinishRequest(requestID graphsync.RequestID) (hasAllBlocks bool)
- func (lt *LinkTracker) IsKnownMissingLink(requestID graphsync.RequestID, link ipld.Link) bool
- func (lt *LinkTracker) RecordLinkTraversal(requestID graphsync.RequestID, link ipld.Link, hasBlock bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LinkTracker ¶
type LinkTracker struct {
// contains filtered or unexported fields
}
LinkTracker records links being traversed to determine useful information in crafting responses for a peer. Specifically, if any in progress request has already sent a block for a given link, don't send it again. Second, keep track of whether links are missing blocks so you can determine at the end if a complete response has been transmitted.
func (*LinkTracker) BlockRefCount ¶
func (lt *LinkTracker) BlockRefCount(link ipld.Link) int
BlockRefCount returns the number of times a present block has been traversed by in progress requests
func (*LinkTracker) Empty ¶
func (lt *LinkTracker) Empty() bool
Empty returns true if the link tracker is empty
func (*LinkTracker) FinishRequest ¶
func (lt *LinkTracker) FinishRequest(requestID graphsync.RequestID) (hasAllBlocks bool)
FinishRequest records that we have completed the given request, and returns true if all links traversed had blocks present.
func (*LinkTracker) IsKnownMissingLink ¶
func (lt *LinkTracker) IsKnownMissingLink(requestID graphsync.RequestID, link ipld.Link) bool
IsKnownMissingLink returns whether the given request recorded the given link as missing
func (*LinkTracker) RecordLinkTraversal ¶
func (lt *LinkTracker) RecordLinkTraversal(requestID graphsync.RequestID, link ipld.Link, hasBlock bool)
RecordLinkTraversal records that we traversed a link during a request, and whether we had the block when we did it.