Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GinRateLimit ¶
func GinRateLimit(switchName, rateName string) gin.HandlerFunc
func GinRecovery ¶
func GinRecovery() gin.HandlerFunc
Types ¶
type LogFormatterParams ¶
type LogFormatterParams struct {
// StatusCode is HTTP response code.
StatusCode int
// Latency is how much time the server cost to process a certain request.
Latency time.Duration
// ClientIP equals Context's ClientIP method.
ClientIP string
// Method is the HTTP method given to the request.
Method string
// Path is a path the client requests.
Path string
// ErrorMessage is set if error has occurred in processing the request.
ErrorMessage string
// BodySize is the size of the Response Body
BodySize int
//userId
UserId int64
}
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
func NewRateLimiter ¶
func NewRateLimiter(switchName, rateName string) *RateLimiter
Click to show internal directories.
Click to hide internal directories.