nettools

package
v0.0.0-...-acb94a3 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BinaryToDottedPort

func BinaryToDottedPort(port string) string

func DottedPortToBinary

func DottedPortToBinary(b string) string

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.

Jump to

Keyboard shortcuts

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