Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PeerProviderFinder ¶
PeerProviderFinder is an interface for finding providers
type PeerTagger ¶
PeerTagger is an interface for tagging peers with metadata
type SessionPeerManager ¶
type SessionPeerManager struct {
// contains filtered or unexported fields
}
SessionPeerManager tracks and manages peers for a session, and provides the best ones to the session
func New ¶
func New(ctx context.Context, id uint64, tagger PeerTagger, providerFinder PeerProviderFinder) *SessionPeerManager
New creates a new SessionPeerManager
func (*SessionPeerManager) FindMorePeers ¶
func (spm *SessionPeerManager) FindMorePeers(ctx context.Context, c cid.Cid)
FindMorePeers attempts to find more peers for a session by searching for providers for the given Cid
func (*SessionPeerManager) GetOptimizedPeers ¶
func (spm *SessionPeerManager) GetOptimizedPeers() []peer.ID
GetOptimizedPeers returns the best peers available for a session
func (*SessionPeerManager) RecordPeerRequests ¶
func (spm *SessionPeerManager) RecordPeerRequests(p []peer.ID, ks []cid.Cid)
RecordPeerRequests records that a given set of peers requested the given cids
func (*SessionPeerManager) RecordPeerResponse ¶
func (spm *SessionPeerManager) RecordPeerResponse(p peer.ID, k cid.Cid)
RecordPeerResponse records that a peer received a block, and adds to it the list of peers if it wasn't already added
Click to show internal directories.
Click to hide internal directories.