ratelimit

package
v0.0.0-...-cbaa3f3 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RateLimit

type RateLimit struct {
	Id         int64
	LimitType  string
	Count      int64
	RemoteAddr string

	Created int64
	Updated int64
	Version int64
}

type RateLimiter

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

func NewRateLimiter

func NewRateLimiter(db *gorp.DbMap) *RateLimiter

func (*RateLimiter) Try

func (r *RateLimiter) Try(remoteAddr, limitType string, maxCount,
	minInterval int64) bool

Jump to

Keyboard shortcuts

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