floodPreventers

package
v1.0.116 Latest Latest
Warning

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

Go to latest
Published: May 17, 2020 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const WildcardCharacter = "*"

WildcardCharacter is the character string used to specify that the topic refers to a

Variables

This section is empty.

Functions

func NewNilTopicFloodPreventer

func NewNilTopicFloodPreventer() *nilTopicFloodPreventer

NewNilTopicFloodPreventer returns a new instance of nilTopicFloodPreventer

func NewQuotaFloodPreventer

func NewQuotaFloodPreventer(
	cacher storage.Cacher,
	statusHandlers []QuotaStatusHandler,
	maxMessagesPerPeer uint32,
	maxTotalSizePerPeer uint64,
	maxMessages uint32,
	maxTotalSize uint64,
) (*quotaFloodPreventer, error)

NewQuotaFloodPreventer creates a new flood preventer based on quota / peer

func NewTopicFloodPreventer

func NewTopicFloodPreventer(
	maxMessagesPerPeer uint32,
) (*topicFloodPreventer, error)

NewTopicFloodPreventer creates a new flood preventer based on topic

Types

type QuotaStatusHandler

type QuotaStatusHandler interface {
	ResetStatistics()
	AddQuota(identifier string, numReceived uint32, sizeReceived uint64, numProcessed uint32, sizeProcessed uint64)
	SetGlobalQuota(numReceived uint32, sizeReceived uint64, numProcessed uint32, sizeProcessed uint64)
	IsInterfaceNil() bool
}

QuotaStatusHandler defines the behavior of a quota handler able to process periodic updates of peers quota measured by the system

Jump to

Keyboard shortcuts

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