Documentation ¶
Index ¶
- Variables
- func GetClientIp(r *http.Request) string
- func McConvert(handler negroni.Handler) mux.MiddlewareFunc
- func NewCors() *cors.Cors
- func NewMiddleWareFunc(handler func(*http.Request) (*http.Request, error)) func(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)
- func ProductProbeAction(req *http.Request) (*http.Request, error)
- func Record(requestInfo *xreq.RequestInfo)
- func UpdateMonitor(req *http.Request, requestInfo *xreq.RequestInfo)
- func UserProbeAction(req *http.Request) (*http.Request, error)
- type LoggerMiddleWare
- type ProductProbeParam
- type Recovery
Constants ¶
This section is empty.
Variables ¶
View Source
var ( McProductProbe = convert(ProductProbeAction) McUserProbe = convert(UserProbeAction) )
View Source
var ( MCRecovery = McConvert(NewRecovery()) MCLogger = McConvert(NewLoggerMiddleWare()) MCCors = McConvert(NewCors()) )
Functions ¶
func GetClientIp ¶
func NewCors ¶
NewCors enable Cross-Origin Resource Sharing detail see: https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Access_control_CORS
func NewMiddleWareFunc ¶
func Record ¶
func Record(requestInfo *xreq.RequestInfo)
func UpdateMonitor ¶
func UpdateMonitor(req *http.Request, requestInfo *xreq.RequestInfo)
Types ¶
type LoggerMiddleWare ¶
type LoggerMiddleWare struct{}
API access logger
func NewLoggerMiddleWare ¶
func NewLoggerMiddleWare() *LoggerMiddleWare
func (*LoggerMiddleWare) ServeHTTP ¶
func (l *LoggerMiddleWare) ServeHTTP(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)
type ProductProbeParam ¶
Click to show internal directories.
Click to hide internal directories.