ratelimit

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupVisitors

func CleanupVisitors()

CleanupVisitors checks the map for visitors that haven't been seen for more than 2 minutes and delete the entries.

func GetVisitor

func GetVisitor(ip string) *rate.Limiter

GetVisitor gets the visitor IP address.

Types

type Visitor

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

Visitor is a struct which holds the rate limiter for each visitor and the last time that the visitor was seen.

Jump to

Keyboard shortcuts

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