Documentation ¶
Overview ¶
====================================================
# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : log.go # Created : 2019/1/8 16:46 # Last Modified : 2019/1/8 16:46 # Describe : # # ====================================================
====================================================
# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : metrics.go # Created : 2019/1/8 17:47 # Last Modified : 2019/1/8 17:47 # Describe : # # ====================================================
====================================================
# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : opentracing.go # Created : 2019/1/8 16:54 # Last Modified : 2019/1/8 16:54 # Describe : # # ====================================================
====================================================
# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : recovery.go # Created : 2019/1/8 16:48 # Last Modified : 2019/1/8 16:48 # Describe : # # ====================================================
====================================================
# Copyright (C)2019 All rights reserved. # # Author : domchan # Email : 814172254@qq.com # File Name : request_id.go # Created : 2019/1/8 16:49 # Last Modified : 2019/1/8 16:49 # Describe : # # ====================================================
Index ¶
- func LoggingMiddleware(next http.Handler) http.Handler
- func RecoveryMiddleware(returnFunc func(w http.ResponseWriter, r *http.Request, err interface{})) func(http.Handler) http.Handler
- func RequestID(ctx context.Context) string
- func RequestIDMiddleware(next http.Handler) http.Handler
- type Metrics
- type OpenTracing
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoggingMiddleware ¶
LoggingMiddleware 返回日志middleware
func RecoveryMiddleware ¶
func RecoveryMiddleware(returnFunc func(w http.ResponseWriter, r *http.Request, err interface{})) func(http.Handler) http.Handler
RecoveryMiddleware 防止程序因为不可预测的原因退出
Types ¶
type OpenTracing ¶
type OpenTracing struct {
// contains filtered or unexported fields
}
OpenTracing 用于跟踪请求的中间件
func NewOpenTracing ¶
func NewOpenTracing(https bool) *OpenTracing