middleware

package
v0.1.16 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Limiter

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

func (*Limiter) Attempts

func (l *Limiter) Attempts(key string) int

func (*Limiter) Hit

func (l *Limiter) Hit(key string, minutes int) int

func (*Limiter) ResetAttempts

func (l *Limiter) ResetAttempts(key string) bool

func (*Limiter) TooManyAttempts

func (l *Limiter) TooManyAttempts(key string, max int) bool

type ThrottleRequests

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

func Throttle

func Throttle(minutes int, max int) *ThrottleRequests

func ThrottleFromCache added in v0.1.1

func ThrottleFromCache(cache cache.Repository, minutes int, max int) *ThrottleRequests

Jump to

Keyboard shortcuts

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