ratelimiter

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MiddlewarePeerRequestPerSecondKey = "Key.MiddlewarePeerRequestPerSecond"
	OpenSessionPerMinuteKey           = "Key.OpenSessionPerMinute"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RateLimitInfo

type RateLimitInfo struct {
	redis_rate.Limit
	KeyPrefix string
}

type RateLimiter

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

func New

func New(ctx context.Context, rateLimit RateLimitInfo) *RateLimiter

func (*RateLimiter) Allowed

func (p *RateLimiter) Allowed(ctx context.Context, name string) bool

Jump to

Keyboard shortcuts

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