Documentation ¶ Index ¶ type PeerSet func New() *PeerSet func NewLimited(size int) *PeerSet func (ps *PeerSet) Add(p peer.ID) func (ps *PeerSet) Contains(p peer.ID) bool func (ps *PeerSet) Size() int func (ps *PeerSet) TryAdd(p peer.ID) bool Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type PeerSet ¶ type PeerSet struct { // contains filtered or unexported fields } PeerSet is a threadsafe set of peers func New ¶ func New() *PeerSet func NewLimited ¶ func NewLimited(size int) *PeerSet func (*PeerSet) Add ¶ func (ps *PeerSet) Add(p peer.ID) func (*PeerSet) Contains ¶ func (ps *PeerSet) Contains(p peer.ID) bool func (*PeerSet) Size ¶ func (ps *PeerSet) Size() int func (*PeerSet) TryAdd ¶ func (ps *PeerSet) TryAdd(p peer.ID) bool TryAdd Attempts to add the given peer into the set. This operation can fail for one of two reasons: 1) The given peer is already in the set 2) The number of peers in the set is equal to size Source Files ¶ View all Source files peerset.go Click to show internal directories. Click to hide internal directories.