Documentation ¶
Index ¶
- func CacheByRawData(cacheExpire time.Duration, forgetTimeout time.Duration, opts ...cache.Option) gin.HandlerFunc
- func CacheByRequestPath(cacheExpire time.Duration, forgetTimeout time.Duration, opts ...cache.Option) gin.HandlerFunc
- func CacheByRequestURI(cacheExpire time.Duration, forgetTimeout time.Duration, opts ...cache.Option) gin.HandlerFunc
- func CheckBlacklist(asAPI bool) gin.HandlerFunc
- func CheckPathOr404() gin.HandlerFunc
- func CheckWhitelist(asAPI bool) gin.HandlerFunc
- func CounterStats() map[string]any
- func DefaultLogCondition(c *gin.Context, elapsed time.Duration) bool
- func HTTPCounter(name string) gin.HandlerFunc
- func RecoveryWithLog(stack bool) gin.HandlerFunc
- func WebLogger(cond LogCondition) gin.HandlerFunc
- type LogCondition
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CacheByRawData ¶
func CacheByRawData(cacheExpire time.Duration, forgetTimeout time.Duration, opts ...cache.Option) gin.HandlerFunc
CacheByRawData 以请求参数 Hash 值为键, 缓存请求结果
func CacheByRequestPath ¶
func CacheByRequestPath(cacheExpire time.Duration, forgetTimeout time.Duration, opts ...cache.Option) gin.HandlerFunc
CacheByRequestPath 以请求 URL.Path 为键, 缓存请求结果
func CacheByRequestURI ¶
func CacheByRequestURI(cacheExpire time.Duration, forgetTimeout time.Duration, opts ...cache.Option) gin.HandlerFunc
CacheByRequestURI 以请求 URL 为键, 缓存请求结果
func CounterStats ¶
func RecoveryWithLog ¶
func RecoveryWithLog(stack bool) gin.HandlerFunc
RecoveryWithLog GinRecovery 及日志 Ref: https://github.com/gin-contrib/zap
func WebLogger ¶
func WebLogger(cond LogCondition) gin.HandlerFunc
WebLogger Web 日志, 记录错误日志, 推送请求日志到接口
Types ¶
Click to show internal directories.
Click to hide internal directories.