Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultTimeoutHandler holds the message that will be thrown when processing time cross the timeout. DefaultTimeoutHandler = http.HandlerFunc( func(res http.ResponseWriter, req *http.Request) { res.WriteHeader(http.StatusGatewayTimeout) res.Write([]byte("Service timeout")) }) )
Functions ¶
func GzipHandler ¶
GzipHandler will help in compressing the response served as per the call made to neuron.
func JsonHandler ¶
JsonHandler will set the header with content-type json.
Types ¶
type GzipMiddleware ¶
GzipMiddleware holds the http handler which has to be compressed.
func (*GzipMiddleware) ServeHTTP ¶
func (gm *GzipMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request)
type TimeoutMiddleware ¶
TimeoutMiddleware holds the http handler for which timeout has to be set.
func (TimeoutMiddleware) ServeHTTP ¶
func (tm TimeoutMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.