Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorHandler ¶
ErrorHandler handler error
var DefaultFailureHandler ErrorHandler = func(ctx *gin.Context) { rushLogger.Error("rate limited access, pease check again later") ctx.AbortWithStatusJSON(http.StatusBadRequest, gin.H{"message": "rate limited access, pease check again later"}) }
DefaultFailureHandler default error handler
type Frequency ¶
type Frequency struct { Passages []string Rules []Rule Model Model FailureHandler ErrorHandler }
Frequency limit
type Limit ¶
type Limit struct {
Frequency *Frequency
}
Limit plugin
func (*Limit) AddOptions ¶
AddOptions defined add option
type Model ¶
type Model interface { Save(string, string, string, int) Find(string, string, string, int) interface{} }
Model token store
type RedisModel ¶
RedisModel adapter for redis
Click to show internal directories.
Click to hide internal directories.