Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlackList ¶
type BlackList interface { // AddPeer append a peer id to blacklist. AddPeer(pid peer.ID) // RemovePeer delete a peer id from blacklist. If pid not exist in blacklist, it is a no-op. RemovePeer(pid peer.ID) // AddIPAndPort append a string contains an ip or a net.Addr string with an ip and a port to blacklist. // The string should be in the following format: // "192.168.1.2:9000" or "192.168.1.2" or "[::1]:9000" or "[::1]" AddIPAndPort(ipAndPort string) // RemoveIPAndPort delete a string contains an ip or a net.Addr string with an ip and a port from blacklist. // If the string not exist in blacklist, it is a no-op. RemoveIPAndPort(ipAndPort string) // IsBlack check whether the remote peer id or the remote net address of the connection given exist in blacklist. IsBlack(conn network.Conn) bool }
BlackList is a blacklist implementation for net addresses or peer ids .
Click to show internal directories.
Click to hide internal directories.