ripple-api/app/peppy_method.go

21 lines
485 B
Go
Raw Normal View History

package app
import (
"github.com/gin-gonic/gin"
"github.com/jmoiron/sqlx"
)
// PeppyMethod generates a method for the peppyapi
func PeppyMethod(a func(c *gin.Context, db *sqlx.DB)) gin.HandlerFunc {
return func(c *gin.Context) {
rateLimiter()
2016-07-06 17:36:46 +00:00
perUserRequestLimiter(0, c.ClientIP())
2016-10-02 19:54:23 +00:00
doggo.Incr("requestsbytype.peppy", nil, 1)
2016-10-02 18:07:38 +00:00
// I have no idea how, but I manged to accidentally string the first 4
// letters of the alphabet into a single function call.
a(c, db)
}
}