Documentation ¶
Index ¶
- Constants
- func ContextWithFields(ctx context.Context, fields ...zap.Field) context.Context
- func Cors() gin.HandlerFunc
- func GenerateTraceID() string
- func GinLogger() gin.HandlerFunc
- func GinRecovery(stack bool) gin.HandlerFunc
- func JwtToken(tk *jtoken.JwtInstance) gin.HandlerFunc
- func LimitIP(cache *redis.Client) gin.HandlerFunc
- func LoadTls() gin.HandlerFunc
- func LoginToken() gin.HandlerFunc
- func SignToken() gin.HandlerFunc
- func TraceMiddleware() gin.HandlerFunc
- type Span
- type SpanContext
Constants ¶
View Source
const TraceIDKey = "X-Trace-ID"
Variables ¶
This section is empty.
Functions ¶
func ContextWithFields ¶
func GenerateTraceID ¶
func GenerateTraceID() string
func GinRecovery ¶
func GinRecovery(stack bool) gin.HandlerFunc
GinRecovery recover掉项目可能出现的panic,并使用zap记录相关日志
func LoadTls ¶
func LoadTls() gin.HandlerFunc
func LoginToken ¶
func LoginToken() gin.HandlerFunc
登录token 登录时,token = md5(uid,ts),从redis中获取token对应的用户信息
func TraceMiddleware ¶
func TraceMiddleware() gin.HandlerFunc
Types ¶
Click to show internal directories.
Click to hide internal directories.