blacklist

package
v0.0.0-...-d151d1d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PeerBlackList

type PeerBlackList interface {
	// AddPeerID adds a peer ID to the blacklist.
	AddPeerID(pid peer.ID)

	// RemovePeerID removes a peer ID from the blacklist.
	// If the peer ID does not exist in the blacklist, it is a no-op.
	RemovePeerID(pid peer.ID)

	// AddIPAndPort adds a network address or IP to the blacklist.
	// The address should be in the format "192.168.1.2:9000" or "192.168.1.2" or "[::1]:9000" or "[::1]".
	AddIPAndPort(ipAndPort string)

	// RemoveIPAndPort removes a network address or IP from the blacklist.
	// If the address does not exist in the blacklist, it is a no-op.
	RemoveIPAndPort(ipAndPort string)

	// BlackConn checks if the remote peer ID or network address of the given connection is blacklisted.
	// Returns true if the connection is blacklisted, otherwise false.
	BlackConn(conn network.Connection) bool

	// BlackPID checks if a given peer ID is blacklisted.
	// Returns true if the peer ID is blacklisted, otherwise false.
	BlackPID(pid peer.ID) bool
}

PeerBlackList is an interface for managing a blacklist of network addresses or peer IDs.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL