Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FooHandlerFunc ¶
func FooHandlerFunc(w http.ResponseWriter, r *http.Request)
FooHandlerFunc http处理器函数
func WrapHTTPHandler ¶
func WrapHTTPHandler(h http.Handler) gin.HandlerFunc
WrapHTTPHandler 将http handler包装为gin.HandlerFunc
func WrapHTTPHandlerFunc ¶
func WrapHTTPHandlerFunc(h http.HandlerFunc) gin.HandlerFunc
WrapHTTPHandlerFunc 将http handlerFunc处理器函数包装为gin.HandlerFunc 由于http.Handler底层是一个interface上面有ServeHTTP方法 而http.HandlerFunc实现了http.Handler的ServeHTTP方法,就相当于实现了http.Handler接口 gin.Context包含了w http.ResponseWriter, r *http.Request 所以调用h.ServeHTTP然后包ctx.Writer,ctx.Request传入就可以处理http请求
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.