Versions in this module Expand all Collapse all v0 v0.29.0 Jul 29, 2023 Changes in this version + type BumpFn func(value DecayingValue, delta int) (after int) + func BumpOverwrite() BumpFn + func BumpSumBounded(min, max int) BumpFn + func BumpSumUnbounded() BumpFn + type ConnManager interface + Close func() error + GetTagInfo func(p peer.ID) *TagInfo + IsProtected func(id peer.ID, tag string) (protected bool) + Notifee func() network.Notifiee + Protect func(id peer.ID, tag string) + TagPeer func(peer.ID, string, int) + TrimOpenConns func(ctx context.Context) + Unprotect func(id peer.ID, tag string) (protected bool) + UntagPeer func(p peer.ID, tag string) + UpsertTag func(p peer.ID, tag string, upsert func(int) int) + type ConnectionGater interface + InterceptAccept func(network.ConnMultiaddrs) (allow bool) + InterceptAddrDial func(peer.ID, ma.Multiaddr) (allow bool) + InterceptPeerDial func(p peer.ID) (allow bool) + InterceptSecured func(network.Direction, peer.ID, network.ConnMultiaddrs) (allow bool) + InterceptUpgraded func(network.Conn) (allow bool, reason control.DisconnectReason) + type DecayFn func(value DecayingValue) (after int, rm bool) + func DecayExpireWhenInactive(after time.Duration) DecayFn + func DecayFixed(minuend int) DecayFn + func DecayLinear(coef float64) DecayFn + func DecayNone() DecayFn + type Decayer interface + RegisterDecayingTag func(name string, interval time.Duration, decayFn DecayFn, bumpFn BumpFn) (DecayingTag, error) + func SupportsDecay(mgr ConnManager) (Decayer, bool) + type DecayingTag interface + Bump func(peer peer.ID, delta int) error + Close func() error + Interval func() time.Duration + Name func() string + Remove func(peer peer.ID) error + type DecayingValue struct + Added time.Time + LastVisit time.Time + Peer peer.ID + Tag DecayingTag + Value int + type NullConnMgr struct + func (NullConnMgr) Close() error + func (NullConnMgr) GetTagInfo(peer.ID) *TagInfo + func (NullConnMgr) IsProtected(peer.ID, string) bool + func (NullConnMgr) Notifee() network.Notifiee + func (NullConnMgr) Protect(peer.ID, string) + func (NullConnMgr) TagPeer(peer.ID, string, int) + func (NullConnMgr) TrimOpenConns(ctx context.Context) + func (NullConnMgr) Unprotect(peer.ID, string) bool + func (NullConnMgr) UntagPeer(peer.ID, string) + func (NullConnMgr) UpsertTag(peer.ID, string, func(int) int) + type TagInfo struct + Conns map[string]time.Time + FirstSeen time.Time + Tags map[string]int + Value int