Versions in this module Expand all Collapse all v0 v0.0.3 Feb 7, 2021 Changes in this version + const ExcessiveScore + const FewScore + const Halflife + const Lifetime + const ManyScore + const NoneScore + const SeriousScore + const SlightScore + var BanDuration time.Duration = defaultBanDuration + var BanThreshold uint32 = defaultBanThreshold + var ErrDialNil = errors.New("config: dial cannot be nil") + func SeedFromDNS(chainParams *params.Params, reqServices protocol.ServiceFlag, ...) + type BanScore uint8 + func (bs BanScore) String() string + type Config struct + Dial func(network, addr string) (net.Conn, error) + GetNewAddress func() (net.Addr, error) + Listeners []net.Listener + OnAccept func(*ConnReq) + OnConnection func(*ConnReq) + OnDisconnection func(*ConnReq) + RetryDuration time.Duration + TargetOutbound uint32 + type ConnManager struct + func New(cfg *Config) (*ConnManager, error) + func (cm *ConnManager) Connect(c *ConnReq) + func (cm *ConnManager) Disconnect(id uint64) + func (cm *ConnManager) NewConnReq() + func (cm *ConnManager) Remove(id uint64) + func (cm *ConnManager) Start() + func (cm *ConnManager) Stop() + func (cm *ConnManager) Wait() + type ConnReq struct + Addr net.Addr + Ban bool + Permanent bool + func NewConnReq() *ConnReq + func (c *ConnReq) Conn() net.Conn + func (c *ConnReq) ID() uint64 + func (c *ConnReq) SetConn(conn net.Conn) + func (c *ConnReq) State() ConnState + func (c *ConnReq) String() string + type ConnState uint32 + const ConnCanceled + const ConnDisconnected + const ConnEstablished + const ConnFailing + const ConnPending + type DynamicBanScore struct + func (s *DynamicBanScore) Increase(persistent, transient uint32) uint32 + func (s *DynamicBanScore) Int() uint32 + func (s *DynamicBanScore) Reset() + func (s *DynamicBanScore) String() string + type LookupFunc func(string) ([]net.IP, error) + type OnSeed func(addrs []*types.NetAddress)