rate

package
v0.0.0-...-e765db0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2021 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IPRateLimitMiddleware

func IPRateLimitMiddleware(limit int, burst int) gin.HandlerFunc

IPRateLimitMiddleware serve caller to added ip rate limit into gin

Types

type IP

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

IP is a ip rate limiter

func NewIP

func NewIP(limit rate.Limit, burst int) *IP

NewIP serve caller to new an IP rate limiter

func (*IP) Limiter

func (i *IP) Limiter(ip string) *rate.Limiter

Limiter serve caller get limiter by IP

Jump to

Keyboard shortcuts

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