Documentation ¶
Overview ¶
Package wantlist implements an object for bitswap that contains the keys that a given peer wants.
Index ¶
- type Entry
- type Wantlist
- func (w *Wantlist) Absorb(other *Wantlist)
- func (w *Wantlist) Add(c cid.Cid, priority int32, wantType pb.Message_Wantlist_WantType) bool
- func (w *Wantlist) Contains(c cid.Cid) (Entry, bool)
- func (w *Wantlist) Entries() []Entry
- func (w *Wantlist) Len() int
- func (w *Wantlist) Remove(c cid.Cid) bool
- func (w *Wantlist) RemoveType(c cid.Cid, wantType pb.Message_Wantlist_WantType) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry struct { Cid cid.Cid Priority int32 WantType pb.Message_Wantlist_WantType }
Entry is an entry in a want list, consisting of a cid and its priority
type Wantlist ¶
type Wantlist struct {
// contains filtered or unexported fields
}
Wantlist is a raw list of wanted blocks and their priorities
func (*Wantlist) Contains ¶
Contains returns the entry, if present, for the given CID, plus whether it was present.
func (*Wantlist) Entries ¶
Entries returns all wantlist entries for a want list, sorted by priority.
DO NOT MODIFY. The returned list is cached.
func (*Wantlist) RemoveType ¶
Remove removes the given cid from the wantlist, respecting the type: Remove with want-have will not remove an existing want-block.
Click to show internal directories.
Click to hide internal directories.