aboutsummaryrefslogtreecommitdiff
path: root/handler.go
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus.dahlberg@kau.se>2020-11-05 11:40:49 +0100
committerRasmus Dahlberg <rasmus.dahlberg@kau.se>2020-11-05 11:40:49 +0100
commiteda3037a9c52596da61d6bb4f06e7cd4d5964756 (patch)
treeb46b27f45a0e56b147ea1345b89bdf3881ac4053 /handler.go
parentd81ae4db5dbba0f086bca0efca837ec8bccc21f6 (diff)
renamed appHandler to handler
Diffstat (limited to 'handler.go')
-rw-r--r--handler.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/handler.go b/handler.go
index 71c624a..e3b15cf 100644
--- a/handler.go
+++ b/handler.go
@@ -11,16 +11,16 @@ import (
"github.com/google/trillian"
)
-// appHandler implements the http.Handler interface, and contains a reference
+// handler implements the http.Handler interface, and contains a reference
// to an STFE server instance as well as a function that uses it.
-type appHandler struct {
+type handler struct {
instance *Instance // STFE server instance
endpoint string // e.g., add-entry
method string // e.g., GET
handler func(context.Context, *Instance, http.ResponseWriter, *http.Request) (int, error)
}
-func (a appHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
+func (a handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// export prometheus metrics
var now time.Time = time.Now()
var statusCode int
@@ -46,7 +46,7 @@ func (a appHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
}
-func (a appHandler) sendHTTPError(w http.ResponseWriter, statusCode int, err error) {
+func (a handler) sendHTTPError(w http.ResponseWriter, statusCode int, err error) {
http.Error(w, http.StatusText(statusCode), statusCode)
}