peerset

package
v0.3.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2015 License: MIT Imports: 2 Imported by: 0

Documentation

Index

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL