redis

package
v0.10.4 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Middleware

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

Middleware struct

func NewMiddleware

func NewMiddleware(rateLimiter goratelimiterredis.RateLimiter) (
	*Middleware,
	error,
)

NewMiddleware creates a new rate limiter middleware

Parameters:

rateLimiter goratelimiterredis.RateLimiter: the rate limiter

Returns:

*Middleware: the middleware instance error: if the rate limiter is nil

func (Middleware) Limit

func (m Middleware) Limit() func(next http.Handler) http.Handler

Limit limits the number of requests per IP address

Returns:

func(next http.Handler) http.Handler: the middleware function

Jump to

Keyboard shortcuts

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