Documentation ¶
Index ¶
- type WantManager
- func (wm *WantManager) CancelWants(ctx context.Context, ks []cid.Cid, peers []peer.ID, ses uint64)
- func (wm *WantManager) CurrentBroadcastWants() []*wantlist.Entry
- func (wm *WantManager) CurrentWants() []*wantlist.Entry
- func (wm *WantManager) IsWanted(c cid.Cid) bool
- func (wm *WantManager) SetDelegate(wantSender WantSender)
- func (wm *WantManager) Shutdown()
- func (wm *WantManager) Startup()
- func (wm *WantManager) WantBlocks(ctx context.Context, ks []cid.Cid, peers []peer.ID, ses uint64)
- func (wm *WantManager) WantCount() int
- type WantSender
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WantManager ¶
type WantManager struct {
// contains filtered or unexported fields
}
WantManager manages a global want list. It tracks two seperate want lists - one for all wants, and one for wants that are specifically broadcast to the internet.
func New ¶
func New(ctx context.Context) *WantManager
New initializes a new WantManager for a given context.
func (*WantManager) CancelWants ¶
CancelWants removes the given cids from the wantlist, tracked by the given session.
func (*WantManager) CurrentBroadcastWants ¶
func (wm *WantManager) CurrentBroadcastWants() []*wantlist.Entry
CurrentBroadcastWants returns the current list of wants that are broadcasts.
func (*WantManager) CurrentWants ¶
func (wm *WantManager) CurrentWants() []*wantlist.Entry
CurrentWants returns the list of current wants.
func (*WantManager) IsWanted ¶
func (wm *WantManager) IsWanted(c cid.Cid) bool
IsWanted returns whether a CID is currently wanted.
func (*WantManager) SetDelegate ¶
func (wm *WantManager) SetDelegate(wantSender WantSender)
SetDelegate specifies who will send want changes out to the internet.
func (*WantManager) Shutdown ¶
func (wm *WantManager) Shutdown()
Shutdown ends processing for the want manager.
func (*WantManager) Startup ¶
func (wm *WantManager) Startup()
Startup starts processing for the WantManager.
func (*WantManager) WantBlocks ¶
WantBlocks adds the given cids to the wantlist, tracked by the given session.
func (*WantManager) WantCount ¶
func (wm *WantManager) WantCount() int
WantCount returns the total count of wants.