Documentation ¶
Index ¶
- func AccessLog(appName string) gin.HandlerFunc
- func AddAccessLogHeader(headers []string)
- func AddIgnoreTraceLogPath(path string, ignore bool)
- func CORS() gin.HandlerFunc
- func GinProxy[Rsp any](c *gin.Context, host, uri string) (rsp Rsp, err error)
- func GinPureProxy(c *gin.Context, host string)
- func Limiter(appName string, rl *limiter.RateLimiter) gin.HandlerFunc
- func Logger() gin.HandlerFunc
- func Recovery() gin.HandlerFunc
- func SetAccessLogHeader(headers []string)
- func SetIgnoreTraceLog(ignore bool)
- type CommonRsp
- type HttpRsp
- type OutputLog
- type RecoveryInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccessLog ¶ added in v0.0.6
func AccessLog(appName string) gin.HandlerFunc
AccessLog middleware for request and response body
func AddAccessLogHeader ¶ added in v0.0.6
func AddAccessLogHeader(headers []string)
func AddIgnoreTraceLogPath ¶ added in v0.0.9
func Limiter ¶
func Limiter(appName string, rl *limiter.RateLimiter) gin.HandlerFunc
Limiter gin middleware limiter if rl is nil, default Bucket = 1000, Rate = 1000
func SetAccessLogHeader ¶ added in v0.0.6
func SetAccessLogHeader(headers []string)
func SetIgnoreTraceLog ¶ added in v0.0.9
func SetIgnoreTraceLog(ignore bool)
Types ¶
type OutputLog ¶ added in v0.0.6
type OutputLog struct { // common AppName string `json:"app_name"` CostMs int64 `json:"cost_ms"` Ts int64 `json:"ts"` // request ClientIP string `json:"client_ip"` Method string `json:"method"` Schema string `json:"schema"` Host string `json:"host"` Path string `json:"path"` ReqHeader string `json:"req_header"` ReqBody string `json:"req_body"` // response StatusCode int `json:"status_code"` ResHeader string `json:"res_header"` ResCode int `json:"res_code"` ResMsg string `json:"res_msg"` ResBody string `json:"res_body"` }
Click to show internal directories.
Click to hide internal directories.