net

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2018 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewThrottledConnection

func NewThrottledConnection(conn net.Conn, speed int64, timeout time.Duration) net.Conn

NewThrottledConnection creates a throttled connection which is done by https://github.com/juju/ratelimit

Types

type IPConnCount

type IPConnCount struct {
	// contains filtered or unexported fields
}

IPConnCount keep tracks of how many connections allowed per IP

func NewIPConnCount

func NewIPConnCount() *IPConnCount

func (*IPConnCount) DecCount

func (ipc *IPConnCount) DecCount(clientIP string)

func (*IPConnCount) IncCount

func (ipc *IPConnCount) IncCount(clientIP string) int

func (*IPConnCount) Read

func (ipc *IPConnCount) Read(clientIP string) int

Jump to

Keyboard shortcuts

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