Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHertzHTTPHandler ¶
func NewHertzHTTPHandler(h http.Handler) app.HandlerFunc
NewHertzHTTPHandler wraps net/http handler to hertz app.HandlerFunc, so it can be passed to hertz server
While this function may be used for easy switching from net/http to hertz, it has the following drawbacks comparing to using manually written hertz request handler:
A lot of useful functionality provided by hertz is missing from net/http handler.
net/http -> hertz handler conversion has some overhead, so the returned handler will be always slower than manually written hertz handler.
So it is advisable using this function only for net/http -> hertz switching. Then manually convert net/http handlers to hertz handlers
func NewHertzHTTPHandlerFunc ¶
func NewHertzHTTPHandlerFunc(h http.HandlerFunc) app.HandlerFunc
NewHertzHTTPHandlerFunc wraps net/http handler to hertz app.HandlerFunc, so it can be passed to hertz server
While this function may be used for easy switching from net/http to hertz, it has the following drawbacks comparing to using manually written hertz request handler:
A lot of useful functionality provided by hertz is missing from net/http handler.
net/http -> hertz handler conversion has some overhead, so the returned handler will be always slower than manually written hertz handler.
So it is advisable using this function only for net/http -> hertz switching. Then manually convert net/http handlers to hertz handlers
Types ¶
This section is empty.