aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus.dahlberg@kau.se>2022-04-04 13:04:45 +0200
committerRasmus Dahlberg <rasmus.dahlberg@kau.se>2022-04-04 13:04:45 +0200
commitd0c9de5a6510c7ce14f0456e84be65eb35a0f32b (patch)
tree96d31c3e56f4c19221b9cd24e235d89dbfd6b373
parenta024ee8f72db6338b0418c708aa78ec9a5838f4f (diff)
rename "a Handler" -> "h Handler"
-rw-r--r--pkg/instance/handler.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/pkg/instance/handler.go b/pkg/instance/handler.go
index de1cc86..ca3395e 100644
--- a/pkg/instance/handler.go
+++ b/pkg/instance/handler.go
@@ -28,23 +28,23 @@ func (h Handler) Path() string {
}
// ServeHTTP is part of the http.Handler interface
-func (a Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
+func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
start := time.Now()
code := 0
defer func() {
end := time.Now().Sub(start).Seconds()
sc := fmt.Sprintf("%d", code)
- rspcnt.Inc(a.Instance.LogID, string(a.Endpoint), sc)
- latency.Observe(end, a.Instance.LogID, string(a.Endpoint), sc)
+ rspcnt.Inc(h.Instance.LogID, string(h.Endpoint), sc)
+ latency.Observe(end, h.Instance.LogID, string(h.Endpoint), sc)
}()
- reqcnt.Inc(a.Instance.LogID, string(a.Endpoint))
+ reqcnt.Inc(h.Instance.LogID, string(h.Endpoint))
- code = a.verifyMethod(w, r)
+ code = h.verifyMethod(w, r)
if code != 0 {
return
}
- code = a.handle(w, r)
+ code = h.handle(w, r)
}
// verifyMethod checks that an appropriate HTTP method is used. Error handling