Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BinaryToDottedPort ¶
func DottedPortToBinary ¶
97.98.99.100:25958 becames "abcdef" or an empty string if the input is invalid.
Types ¶
type ClientThrottle ¶
type ClientThrottle struct {
// contains filtered or unexported fields
}
ClientThrottle identifies and blocks hosts that are too spammy. It only cares about the number of operations per minute.
func NewThrottler ¶
func NewThrottler(maxPerMinute int, maxHosts int64) *ClientThrottle
func (*ClientThrottle) CheckBlock ¶
func (r *ClientThrottle) CheckBlock(host string) bool
func (*ClientThrottle) Stop ¶
func (r *ClientThrottle) Stop()
Stop the ClientThrottle and all internal goroutines.
Click to show internal directories.
Click to hide internal directories.