ApplyHTTPWrappers apply wrappers according to the order
(handler http.HandlerFunc, wrappers []HTTPHandlerWrapper)
| 137 | |
| 138 | // ApplyHTTPWrappers apply wrappers according to the order |
| 139 | func ApplyHTTPWrappers(handler http.HandlerFunc, wrappers []HTTPHandlerWrapper) http.HandlerFunc { |
| 140 | h := handler |
| 141 | for _, wrapper := range wrappers { |
| 142 | h = wrapper(h) |
| 143 | } |
| 144 | return h |
| 145 | } |
| 146 | |
| 147 | // LimitServe will start a http server on the port with the handler and at most maxConnection concurrent connections. |
| 148 | func LimitServe(port int, handler http.Handler, httpCfg common.HTTPConfig) { |