Versions in this module Expand all Collapse all v0 v0.4.11 Apr 17, 2023 v0.4.1 Apr 3, 2023 Changes in this version + type BlockPresence int + const BPDontHave + const BPHave + const BPUnknown + type PeerManager interface + BroadcastWantHaves func(context.Context, []cid.Cid) + RegisterSession func(peer.ID, bspm.Session) + SendCancels func(context.Context, []cid.Cid) + SendWants func(ctx context.Context, peerId peer.ID, wantBlocks []cid.Cid, wantHaves []cid.Cid) + UnregisterSession func(uint64) + type ProviderFinder interface + FindProvidersAsync func(ctx context.Context, k cid.Cid) <-chan peer.ID + type Session struct + func New(ctx context.Context, sm SessionManager, id uint64, sprm SessionPeerManager, ...) *Session + func (s *Session) GetBlock(ctx context.Context, k cid.Cid) (blocks.Block, error) + func (s *Session) GetBlocks(ctx context.Context, keys []cid.Cid) (<-chan blocks.Block, error) + func (s *Session) ID() uint64 + func (s *Session) ReceiveFrom(from peer.ID, ks []cid.Cid, haves []cid.Cid, dontHaves []cid.Cid) + func (s *Session) SetBaseTickDelay(baseTickDelay time.Duration) + func (s *Session) Shutdown() + type SessionManager interface + CancelSessionWants func(sid uint64, wants []cid.Cid) + RemoveSession func(sesid uint64) + type SessionPeerManager interface + AddPeer func(peer.ID) bool + HasPeers func() bool + Peers func() []peer.ID + PeersDiscovered func() bool + ProtectConnection func(peer.ID) + RemovePeer func(peer.ID) bool + Shutdown func() + type SessionWantsCanceller interface + CancelSessionWants func(sid uint64, wants []cid.Cid)