middleware

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Auth

func Auth(next http.Handler) http.Handler

func AuthMiddleware

func AuthMiddleware(secretKey string) func(next http.Handler) http.Handler

AuthMiddleware is a middleware function for JWT authentication

func Logger

func Logger(next http.Handler) http.Handler

func RateLimiter

func RateLimiter(config RateLimiterConfig) func(http.Handler) http.Handler

RateLimiter is a middleware function to enforce rate limiting.

Types

type RateLimiterConfig

type RateLimiterConfig struct {
	MaxRequests int           // Maximum allowed requests
	Window      time.Duration // Time window for the rate limit
	DB          *badger.DB    // BadgerDB instance
}

RateLimiterConfig defines the settings for the rate limiter.

Source Files

  • auth-v1.go
  • auth.go
  • logger.go
  • ratelimit.go

Jump to

Keyboard shortcuts

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