antiflood

package
v1.0.146 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const DurationBootstrapingTime = 2 * time.Second

DurationBootstrapingTime -

Variables

This section is empty.

Functions

func FloodTheNetwork

func FloodTheNetwork(peer p2p.Messenger, topic string, isFlooding *atomic.Value, messageSize uint64)

FloodTheNetwork -

Types

type MessageProcessor

type MessageProcessor struct {
	FloodPreventer process.FloodPreventer
	// contains filtered or unexported fields
}

MessageProcessor -

func CreateTopicsAndMockInterceptors

func CreateTopicsAndMockInterceptors(
	peers []p2p.Messenger,
	blacklistHandlers []floodPreventers.QuotaStatusHandler,
	topic string,
	peerMaxNumMessages uint32,
	peerMaxSize uint64,
) ([]*MessageProcessor, error)

CreateTopicsAndMockInterceptors -

func (*MessageProcessor) IsInterfaceNil

func (mp *MessageProcessor) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*MessageProcessor) NumMessagesProcessed

func (mp *MessageProcessor) NumMessagesProcessed() uint32

NumMessagesProcessed returns the number of processed messages

func (*MessageProcessor) NumMessagesReceived

func (mp *MessageProcessor) NumMessagesReceived() uint32

NumMessagesReceived returns the number of received messages

func (*MessageProcessor) ProcessReceivedMessage

func (mp *MessageProcessor) ProcessReceivedMessage(message p2p.MessageP2P, fromConnectedPeer core.PeerID) error

ProcessReceivedMessage is the callback function from the p2p side whenever a new message is received

func (*MessageProcessor) SizeMessagesProcessed

func (mp *MessageProcessor) SizeMessagesProcessed() uint64

SizeMessagesProcessed returns the total size of the processed messages

func (*MessageProcessor) SizeMessagesReceived

func (mp *MessageProcessor) SizeMessagesReceived() uint64

SizeMessagesReceived returns the total size of the received messages

Jump to

Keyboard shortcuts

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