Skip to content

YslamB/rate-limiter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Usecases

rate limiter in golang, on gin extension

  • example
func main() {
	r := gin.New()

	rl := NewRateLimiter()

	// Apply the rate limiter middleware to all routes.
	r.Use(RateLimiterMiddleware(rl))

	r.GET("/json", func(c *gin.Context) {
		c.JSON(http.StatusOK, gin.H{"message": "Hello, World!"})
	})

	r.Run() // Listen and serve on 0.0.0.0:8080
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages