summaryrefslogtreecommitdiff
path: root/service/http/handler.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2018-06-13 14:02:14 +0300
committerWolfy-J <[email protected]>2018-06-13 14:02:14 +0300
commitb58bbaa615f38916860e06db27e2ab31b0eb2d08 (patch)
tree8e446b203dd3c2ab47147a6efd864416a88af841 /service/http/handler.go
parent8b24183daa620bb12edf78f6e81697532cbc92d8 (diff)
more tests for files!
Diffstat (limited to 'service/http/handler.go')
-rw-r--r--service/http/handler.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/service/http/handler.go b/service/http/handler.go
index 2d749207..0124a2a4 100644
--- a/service/http/handler.go
+++ b/service/http/handler.go
@@ -97,11 +97,6 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
resp.Write(w)
}
-// handleResponse triggers response event.
-func (h *Handler) handleResponse(req *Request, resp *Response) {
- h.throw(EventResponse, &Event{Method: req.Method, Uri: req.Uri, Status: resp.Status})
-}
-
// handleError sends error.
func (h *Handler) handleError(w http.ResponseWriter, r *http.Request, err error) {
h.throw(EventError, &Event{Method: r.Method, Uri: uri(r), Status: 500, Error: err})
@@ -110,6 +105,11 @@ func (h *Handler) handleError(w http.ResponseWriter, r *http.Request, err error)
w.Write([]byte(err.Error()))
}
+// handleResponse triggers response event.
+func (h *Handler) handleResponse(req *Request, resp *Response) {
+ h.throw(EventResponse, &Event{Method: req.Method, Uri: req.Uri, Status: resp.Status})
+}
+
// throw invokes event srv if any.
func (h *Handler) throw(event int, ctx interface{}) {
h.mul.Lock()