Versions in this module Expand all Collapse all v3 v3.0.1 Aug 8, 2022 Changes in this version + const DefaultFullOutboundUpdateInterval + const DefaultInboundNeighborSize + const DefaultOutboundNeighborSize + const DefaultOutboundUpdateInterval + const DefaultSaltLifetime + func SetParameters(param Parameters) + type DiscoverProtocol interface + EnsureVerified func(*peer.Peer) error + GetVerifiedPeer func(identity.ID) *peer.Peer + GetVerifiedPeers func() []*peer.Peer + IsVerified func(identity.ID, net.IP) bool + type DroppedEvent struct + DroppedID identity.ID + Peer *peer.Peer + type Events struct + Dropped *events.Event + IncomingPeering *events.Event + OutgoingPeering *events.Event + SaltUpdated *events.Event + type Filter struct + func NewFilter() *Filter + func (f *Filter) AddCondition(c func(p *peer.Peer) bool) + func (f *Filter) AddPeer(peer identity.ID) + func (f *Filter) AddPeers(n []*peer.Peer) + func (f *Filter) Apply(list []peer.PeerDistance) (filtered []peer.PeerDistance) + func (f *Filter) Clean() + func (f *Filter) RemovePeer(peer identity.ID) + type Neighborhood struct + func NewNeighborhood(size int) *Neighborhood + func (nh *Neighborhood) Add(toAdd peer.PeerDistance) bool + func (nh *Neighborhood) GetNumPeers() int + func (nh *Neighborhood) GetPeers() []*peer.Peer + func (nh *Neighborhood) IsFull() bool + func (nh *Neighborhood) RemovePeer(id identity.ID) *peer.Peer + func (nh *Neighborhood) Select(candidates []peer.PeerDistance) peer.PeerDistance + func (nh *Neighborhood) String() string + func (nh *Neighborhood) UpdateDistance(anchor, salt []byte) + type Option interface + func DropOnUpdate(dropOnUpdate bool) Option + func Logger(log *logger.Logger) Option + func ManaFunc(manaFunc mana.Func) Option + func NeighborBlockDuration(blockDuration time.Duration) Option + func NeighborSkipTimeout(skipTimeout time.Duration) Option + func NeighborValidator(neighborValidator Validator) Option + func R(r int) Option + func Ro(ro float64) Option + func UseMana(useMana bool) Option + type Parameters struct + FullOutboundUpdateInterval time.Duration + InboundNeighborSize int + OutboundNeighborSize int + OutboundUpdateInterval time.Duration + SaltLifetime time.Duration + type PeeringEvent struct + Distance uint32 + Peer *peer.Peer + Status bool + type Protocol struct + func New(local *peer.Local, disc DiscoverProtocol, opts ...Option) *Protocol + func (p *Protocol) BlockNeighbor(id identity.ID) + func (p *Protocol) Close() + func (p *Protocol) Events() Events + func (p *Protocol) GetIncomingNeighbors() []*peer.Peer + func (p *Protocol) GetNeighbors() []*peer.Peer + func (p *Protocol) GetOutgoingNeighbors() []*peer.Peer + func (p *Protocol) HandleMessage(s *server.Server, fromAddr *net.UDPAddr, from *identity.Identity, data []byte) (bool, error) + func (p *Protocol) PeeringDrop(to *peer.Peer) + func (p *Protocol) PeeringRequest(to *peer.Peer, salt *salt.Salt) (bool, error) + func (p *Protocol) RemoveNeighbor(id identity.ID) + func (p *Protocol) Start(s server.Sender) + type SaltUpdatedEvent struct + Private *salt.Salt + Public *salt.Salt + type Selector interface + Select func(candidates peer.PeerDistance) *peer.Peer + type Validator interface + IsValid func(*peer.Peer) bool + type ValidatorFunc func(p *peer.Peer) bool + func (f ValidatorFunc) IsValid(p *peer.Peer) bool Other modules containing this package github.com/finderAUT/hive.go/v2