Documentation ¶
Index ¶
- type BlockingConnectionGater
- type ConnectionGaterMetrics
- type ExpiryConnectionGater
- func (g *ExpiryConnectionGater) InterceptAccept(mas network.ConnMultiaddrs) (allow bool)
- func (g *ExpiryConnectionGater) InterceptAddrDial(id peer.ID, ma multiaddr.Multiaddr) (allow bool)
- func (g *ExpiryConnectionGater) InterceptPeerDial(p peer.ID) (allow bool)
- func (g *ExpiryConnectionGater) InterceptSecured(direction network.Direction, id peer.ID, mas network.ConnMultiaddrs) (allow bool)
- type ExpiryStore
- type MeteredConnectionGater
- func (g *MeteredConnectionGater) InterceptAccept(mas network.ConnMultiaddrs) (allow bool)
- func (g *MeteredConnectionGater) InterceptAddrDial(id peer.ID, ma multiaddr.Multiaddr) (allow bool)
- func (g *MeteredConnectionGater) InterceptPeerDial(p peer.ID) (allow bool)
- func (g *MeteredConnectionGater) InterceptSecured(dir network.Direction, id peer.ID, mas network.ConnMultiaddrs) (allow bool)
- type Scores
- type ScoringConnectionGater
- func (g *ScoringConnectionGater) InterceptAddrDial(id peer.ID, ma multiaddr.Multiaddr) (allow bool)
- func (g *ScoringConnectionGater) InterceptPeerDial(p peer.ID) (allow bool)
- func (g *ScoringConnectionGater) InterceptSecured(dir network.Direction, id peer.ID, mas network.ConnMultiaddrs) (allow bool)
- type UnbanMetrics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockingConnectionGater ¶
type BlockingConnectionGater interface { connmgr.ConnectionGater // BlockPeer adds a peer to the set of blocked peers. // Note: active connections to the peer are not automatically closed. BlockPeer(p peer.ID) error UnblockPeer(p peer.ID) error ListBlockedPeers() []peer.ID // BlockAddr adds an IP address to the set of blocked addresses. // Note: active connections to the IP address are not automatically closed. BlockAddr(ip net.IP) error UnblockAddr(ip net.IP) error ListBlockedAddrs() []net.IP // BlockSubnet adds an IP subnet to the set of blocked addresses. // Note: active connections to the IP subnet are not automatically closed. BlockSubnet(ipnet *net.IPNet) error UnblockSubnet(ipnet *net.IPNet) error ListBlockedSubnets() []*net.IPNet }
func NewBlockingConnectionGater ¶
func NewBlockingConnectionGater(store ds.Batching) (BlockingConnectionGater, error)
type ConnectionGaterMetrics ¶
type ExpiryConnectionGater ¶
type ExpiryConnectionGater struct { BlockingConnectionGater // contains filtered or unexported fields }
ExpiryConnectionGater enhances a BlockingConnectionGater by implementing ban-expiration
func AddBanExpiry ¶
func AddBanExpiry(gater BlockingConnectionGater, store ExpiryStore, log log.Logger, clock clock.Clock, m UnbanMetrics) *ExpiryConnectionGater
func (*ExpiryConnectionGater) InterceptAccept ¶
func (g *ExpiryConnectionGater) InterceptAccept(mas network.ConnMultiaddrs) (allow bool)
func (*ExpiryConnectionGater) InterceptAddrDial ¶
func (g *ExpiryConnectionGater) InterceptAddrDial(id peer.ID, ma multiaddr.Multiaddr) (allow bool)
func (*ExpiryConnectionGater) InterceptPeerDial ¶
func (g *ExpiryConnectionGater) InterceptPeerDial(p peer.ID) (allow bool)
func (*ExpiryConnectionGater) InterceptSecured ¶
func (g *ExpiryConnectionGater) InterceptSecured(direction network.Direction, id peer.ID, mas network.ConnMultiaddrs) (allow bool)
type ExpiryStore ¶
type ExpiryStore interface { store.IPBanStore store.PeerBanStore }
type MeteredConnectionGater ¶
type MeteredConnectionGater struct { BlockingConnectionGater // contains filtered or unexported fields }
func AddMetering ¶
func AddMetering(gater BlockingConnectionGater, m ConnectionGaterMetrics) *MeteredConnectionGater
func (*MeteredConnectionGater) InterceptAccept ¶
func (g *MeteredConnectionGater) InterceptAccept(mas network.ConnMultiaddrs) (allow bool)
func (*MeteredConnectionGater) InterceptAddrDial ¶
func (g *MeteredConnectionGater) InterceptAddrDial(id peer.ID, ma multiaddr.Multiaddr) (allow bool)
func (*MeteredConnectionGater) InterceptPeerDial ¶
func (g *MeteredConnectionGater) InterceptPeerDial(p peer.ID) (allow bool)
func (*MeteredConnectionGater) InterceptSecured ¶
func (g *MeteredConnectionGater) InterceptSecured(dir network.Direction, id peer.ID, mas network.ConnMultiaddrs) (allow bool)
type ScoringConnectionGater ¶
type ScoringConnectionGater struct { BlockingConnectionGater // contains filtered or unexported fields }
ScoringConnectionGater enhances a ConnectionGater by enforcing a minimum score for peer connections
func AddScoring ¶
func AddScoring(gater BlockingConnectionGater, scores Scores, minScore float64) *ScoringConnectionGater
func (*ScoringConnectionGater) InterceptAddrDial ¶
func (g *ScoringConnectionGater) InterceptAddrDial(id peer.ID, ma multiaddr.Multiaddr) (allow bool)
func (*ScoringConnectionGater) InterceptPeerDial ¶
func (g *ScoringConnectionGater) InterceptPeerDial(p peer.ID) (allow bool)
func (*ScoringConnectionGater) InterceptSecured ¶
func (g *ScoringConnectionGater) InterceptSecured(dir network.Direction, id peer.ID, mas network.ConnMultiaddrs) (allow bool)
type UnbanMetrics ¶
type UnbanMetrics interface { RecordPeerUnban() RecordIPUnban() }
Click to show internal directories.
Click to hide internal directories.