Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 339 Bytes

README.md

File metadata and controls

25 lines (18 loc) · 339 Bytes

gin-ratelimit

gin-ratelimit, a ratelimit middleware for gin.

example:

package main

import (
	"github.com/gin-gonic/gin"
	ratelimit "github.com/jonsen/gin-ratelimit"
)

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

	r.Use(ratelimit.RateLimit(20))

	r.GET("/", func(c *gin.Context) {
		c.String(200, "Hello, world!")
	})

	r.Run(":12345")
}